Trying to Avoid Indicating the SheetName in Write Cell activity

Hi guys,

Can I not indicate the SheetName from using Write Cell?

The reason I asked that is because, My if condition can check beforehand to decide which sheet to look for (let’s say I have 2 sheets, sheet1 and sheet2, and sheet1 meet the checking criteria) then to extract one cell value from that sheet (shee1 here) and eventually I need to update another one cell value for that particular sheet (sheet1 here). So my process doesn’t really have a moment to stick to an indicated sheet to check & update but to check & update it only after the if condition check.

Any way around to achieve writing cell without indicating the SheetName specifically?
Such as applying a generic value to the SheetName etc.

Thanks!

Hello @Victor_Victory

Use of sheet name is important. Because if you have many sheets, the bot wouldn’t know on which sheet it should write on. This is the case even if you have a single sheet. So using the sheet name is mandatory.

However, you can extract the sheet names of a excel file into an array. Use the get excel sheets activity which you can place under a excel application scope and you will be able to extract the sheet names.

Next, use the values in that and perform your task so that you do not need to hard code any sheet names. This is the only way.


Excellence is achieved through constant challenging and breaking off from your limitations. It isn’t taught or given; it begins within you. – @Lahiru.Fernando

You can use -
WB.GetSheet(0)

refer - How to read sheet name of an excel file

by index you can fetch sheets from workbook.
WB is output variable for excel application scope.