Good Morning,
i have a problem with my flow.
i write a script that duplicate a worksheet, and rename it to the todays date.
When i run the script in the Excel file, it will work.
i make a another copy of the file, and it worked there too, also works with power automate
but in the original file it wont work. and i have no idea why.
Can someone explain me why?
function main(workbook: ExcelScript.Workbook) {
//Write current date in currentdate
let currentdate: Date = new Date();
//select last Worksheet
let selectedSheet = workbook.getWorksheet("Leer_nicht_benutzen");
// Duplicate worksheet
let newSheet = selectedSheet.copy(ExcelScript.WorksheetPositionType.before, selectedSheet);
// Rename worksheet to "current date"
newSheet.setName(currentdate.toLocaleString('de-DE').slice(0, 10));
}
if i run it over power automate i get the following error.
We were unable to run the script. Please try again.
Runtime error: Line 9: Cannot read property 'copy' of undefined
clientRequestId: 5b4efa89-569d-4f84-a0ce-0d67cd6eb0e2
i think the problem is here
Solved! Go to Solution.
Error is fixed, I made a stupid mistake. Sheet did not have the same name as in the code.
Error is fixed, I made a stupid mistake. Sheet did not have the same name as in the code.
User | Count |
---|---|
6 | |
6 | |
5 | |
3 | |
2 |
User | Count |
---|---|
11 | |
9 | |
7 | |
7 | |
4 |