I'm trying to create a flow that makes a file based on an email attachment, but the script for the flow isn't running correctly.
Here's the whole flow:


And this is the code fore the script if it's relevant:
function main(workbook: ExcelScript.Workbook,
TableName: string = "Table1",
SheetName: string = "Sheet1"
) {
// Get the worksheet by name
const selectedSheet = workbook.getWorksheet(SheetName);
// Create a table using the data range.
let newTable = workbook.addTable(selectedSheet.getUsedRange(), true);
newTable.setName(TableName);}
The error kickback reads:
We were unable to run the script. Please try again.
The script couldn't create a connection with Excel. Please try again.
clientRequestId: 55e50ca3-4761-4f64-9957-31a80ee13ad5
I'm pretty new to this so any help would be appreciated! Thanks!