Excel Format Copying

Hi All,

Working on an automation that requires creating a copy of an Excel workbook (this part works), then copying a specified range from the template into the new file. The issue I’m facing is when copying the range, UiPath removes any borders, colors, font changes, etc.

I’ve tried using hotkeys to navigate excel menus and manually add the expected formatting, but none of it would save when the file would close. I’ve also tried to use Excel’s ‘Format Painter’ but with the way UiPath selects ranges, it didn’t work.

Anyone know of any ways to complete this task?

Thank you all.

EDIT: Using Studio version 2020.10.4 and UiAutomation v20.10.9 and System.Activities v20.10.4


Use Copy Paste range activity.

Hey @nlee

While using “Read Range”, did you check for the Preserve Format property


Appreciate the response, is there a way to copy range from a template workbook to a new workbook? Looks like the Copy Past Range has to be used within an Excel Application Scope.

From my experience the ‘Preserve Format’ property only saves the input format (General, Number, Text, etc.). I need to save colors, fonts, borders, etc.

You can try with send-hotkeys by keeping excel open.

I believe you have tried, if not please follow the below links.



Is Excel Application installed in Robot machine ? If yes then use Excel Application Scope activities instead of workbook activities.

I am not sure what activities you need to perform between reading the template and saving it to a new file but would it be an option to re-save your template file as the final file?

I wish this was an option, but unfortunately these files have an unknown length of time they will be used and each day has to add a new range to each file.

Excel is installed on the machine, but that only gives me the option to open a single workbook. I would need to copy from Workbook_Template to ActiveUser_File, is there a workaround for this?

Not sure what all columns you nees to copy, but ideal way is to do it using vba/macro , you can record the task you want to perform in a macro and then run that macro at the time you need to copy those data.

Hope this helps!

Thank you,
I will look into how to do this.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.