Only Write Range for Worksheets that exist


#1

Hi,

I noticed that when using the “Write Range” command, UiPath automatically creates a sheet if it doesn’t already exist in the destination Excel file.

How can I make it stop that?

I am currently copy+pasting from one Excel workbook (let’s say Excel1) with multiple sheets to another (say Excel2). Excel 2 contains mainly the same sheets as Excel 1, so I am using “For Each” and “.GetSheets” commands.
However, in some instances Excel1 contains sheets that don’t exist in Excel2. Excel2 however is the standard format so I don’t want UiPath to add sheets to it…

Would appreciate your help!

Best,


#2

Hi Hmori,

Sometimes I noticed that while “Write Range” command processing with write operation, It will delete the Existing Excel file if he found some issue in processing. So next time when bot try to read that file it do not found that “Excel1” file. So It will create new file with the same name. So it may have the same data which you want in “Excel1”. I am not sure but it may the issue.

Thanks,