Cells format changing after an ExcelCopySheet Activity

Hi guys ! :smiley:

I’m still having some hard time with my Excel files … :sweat_smile: Hope you can help me !

I use an ExcelCopySheet activity to copy “Sheet_Excel1” from Excel1 to my second excel file : Excel2.
So now, Excel2 have 2 sheets : “Synthesis” and “Sheet_Excel1”.
The problem is, after the ExcelCopySheet activity, the cells format of Synthesis have changed and I don’t know why …
And I can’t just change the format after for some reasons so I need to find a way to delete this format changing.
Do you have any idea of what I can do ?

Thanks ! :wink:

@Camille361 - If I am not wrong, Only “Copy Paste Range” activity retain the certain formats,value and formulas. Even the “Preserve Formatting” in the read Range won’t preserve the all the formats. This is based on the testing I have done.

Hi @Camille361 ,

The Excel Copy sheet copies the formats I believe.

Are you possibly talking about the Office 365 Excel Copy Sheet?

Try this

Read range workbook sheet 1
Write range new workbook sheet 1/X

Ok but what I don’t understand is why it changes the format of the sheet I don’t modify at all.
I just make activities on Sheet2 but it modifies the format of Sheet1 …

As I explained, the format of the sheet I copied has been copied correctly. But it has modified the format of the other sheet of the document. But I never touch to this sheet in my process…

I tried but I can’t use Write Range in this case because there are formulas linking “Synthesis” and “Sheet_Excel1” … I have some errors saying I’m out of range when I use Write Range …

Try downloading the Balareva Excel activity from the marketplace, the activity, “Change Cell Type” helped me and only takes a second to complete. It helps to format your range in the format you desire.

Here’s an example of the inputs required

Hope this helps, cheers.

1 Like

Thank you but as I explained I cannot just change the cell format after the Excel copy Activity. Because depending on the file, the columns containing numbers are not the same. And i need to create a process able to deal with different excel files

Roger that.
Have you tried enabling “Keep format” within your Excel scope/Read range?
Activity should copy range and maintain same format.

Notice that enabling this Will increase your processing time by some :slight_smile:

Hello @JDK :slight_smile:
Yes I already tried this but still have the same problem.
I tried to realize the same action but with an Excel macro (in VBA) and I’m also facing this problem … So maybe the problem comes from the Excel file and its formulas ^^

already shared with you in the past, but may we ask you to have a second look on it. Sample is handling worksheet copy of a template worksheet in order to keep the predefined formats:

Could you show example of text that has been changed in new sheet? :slight_smile:

Actually, the cells who had their format changing are those on the Sheet I didn’t modify. That’s why it’s weird.
But as I told you I meet the same problem with only using Excel macros. So I wrote my problem on an Excel-VBA forum because it’s not a UiPath problem anymore but an Excel problem ^^

If you know VBA and you still want to help me, tell me and I’ll send you my files in private message :smiley:

Thanks ! :wink: