Forum Discussion

LearnExcelScript's avatar
LearnExcelScript
Copper Contributor
Sep 27, 2023
Solved

Problem ExcelScript in excel files with compatibility mode 97-2003

I don't really know if this is the problem, but after many times of trying to run the most simple lines of code in Excel Typescript, 

 

function main(workbook: ExcelScript.Workbook) {
  const sheet = workbook.getActiveWorksheet();
  let range = sheet.getUsedRange();
   const table = sheet.addTable(range, true);
}
 
it would always show "Error - Worksheet getUsedRange: There was an internal error while processing the request". 
 
But when I copy paste the entire sheet (ctrl + A) into a new excel workbook (excel latest version), the code obviously is coerced. The only conclusion I arrived to is that excel ExcelScript wont run on files labeled as "compatibility mode Microsoft excel 97-2003"
 
Can someone please confirm/challenge this assumption? 
 
Thanks beforehand!

Resources