Write range on excel scope

hello
I make some process on to Data Table on my workflow
and in the end i want robot to write this tables in excel sheet1 and sheet2 but I have this problem
always robot writes sheet2 before sheet1 on excel file even I change order of two write range activities
what should I do to make robot range it Sheet1 , sheet2 not sheet2,sheet1 on excel file?

1
2

I think it writes the new sheet to the left of the existing sheet. So, I would recommend reversing the order of your Write Ranges, so it does Sheet2 first, then Sheet1, which will as a result place them in the correct order.

Disregard my last statement, cause I forgot ‘Sheet1’ already exists by default.

Only way is to delete the sheet after writing Sheet2, then write Sheet1 again.
In order to delete the sheet, you can use the Alt-key combination: “[k(alt)]hds”

So, you would write to Sheet2, then use Select Range to go to Sheet1, then use Type Into with the key combination.

Hope that helps

1 Like

Just as an additional tidbit, you can check to see if Sheet1 exists prior to deletion by using the Workbook Application variable output in your Excel scope.

Let’s say you call this variable ‘wb’
Then, you can in a condition see if it contains “Sheet1”

IF: wb.GetSheets.Contains("Sheet1")
  Then: Select Range "A1" on "Sheet1")
             TypeInto "[k(alt)]hds"

EDIT: also if you don’t like using TypeInto, there is an activity package that likely includes the Delete Sheet action

thank you this is the solution :grinning: :grinning:

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