Forum Discussion
Convert CSV to Excel Office Script
I created the convert csv to excel office script from the template. I used it in power automate to convert all csv files in a folder to excel. It worked great until today now I am receiving and error "selectedsheet not defined". How can I fix this?
22 Replies
- LorenzoSilver Contributor
Suggestion: Post your issue on the dedicated https://powerusers.microsoft.com/t5/Microsoft-Power-Automate/ct-p/MPACommunity with your complete script
- SergeiBaklanDiamond Contributor
Lorenzo , it's in between. An error most probably is in ExcelScript which is run by Power Automate Flow.
- SergeiBaklanDiamond Contributor
Perhaps you mean this Convert CSV files to Excel workbooks - Office Scripts | Microsoft Learn template in which sheet name is defined explicitly ( as "Sheet1"). Be sure all csv files have sheet with such name.
As variant most probably script could be modified to select the sheet not by name but by position, e.g. first sheet in the file.