
Announcements
I have some data that I am cutting from one table and copying to another. I'd like to clear the tables and resize it when done.
I keep getting this error when trying to run to test my script prior to testing in Flow
Cannot read properties of undefined
function main(workbook: ExcelScript.Workbook) {
let targetTable = workbook.getTable("Email Attestation");
let hellorange = targetTable.getRangeBetweenHeaderAndTotal()
hellorange.clear(ExcelScript.ClearApplyTo.contents);
targetTable.resize("A3:I3");
}
here's the articles I've looked at -
https://learn.microsoft.com/en-us/office/dev/scripts/develop/power-automate-integration
https://learn.microsoft.com/en-us/office/dev/scripts/resources/samples/excel-samples
https://learn.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-ranges-clear-delete
https://learn.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-tables
https://learn.microsoft.com/en-us/office/dev/scripts/tutorials/excel-tutorial
okay, I see an issue, it's the Table name
let targetTable = workbook.getTable("Email Attestation");
In the UI for Excel, you cannot have a table with spaces it had an underscore. This is helping me to understand the error messages. If you get "undefined name", it cant find the table you asked for.