As Excel Application Scope has been replaced by Excel Process Scope, what is the equivalent to “Get sheet names”??
I am trying to rename a sheet, but the sheet has a different name every time, so I dont know the name beforehand - I just know that its the first (only) sheet in the file.
Hi @SorenB ,
Excel has 2 packages: Classic and modern
with the class having ‘Excel Application Scope’ and having ‘get work sheet’
When ‘Excel Process Scope’ is in modern, it will give you the sheet option you want
Excel application scope is the Classic activity and Excel process scope is the Modern activity.
To get the first sheet of excel file follow the below process,
→ Take the Excel process scope activity and insert the use excel file activity inside of it.
→ Pass the Path of the excel file in the Use excel file activity.
→ Insert the For each excel sheet activity inside the use excel file.
→ Inside for each insert the Assign activity and create a String datatype variable called FirstSheet to store the first sheet name.
→ After assign insert break activity to break the loop after first iteration.
→ Outside of for each you can use that variable to pass the sheet name in any activity.
Check the below workflow for better understanding, I have developed the code dynamically to get the first sheet name, if everytime the first sheet name changes it will be stored into a variable called Firstsheet.
Thank you for your suggestion, however I am trying not to mix Classic and Modern.
I am aware of the option to let Excel Process Scope fetch the sheet name for me (when I am developing), but in the live environment I dont know the sheet name beforehand.