Copy link to clipboard
Copied
Dear Indesign-script developers!
i'm scripting the import of xls tables that are placed in the indd. within the excelimportpreferences i can define the range of cells to import by "range = a1:b4" (importing row a column1 to row b column4)
simple question: is there a way to get the last row and last column of the xls table? with last i mean the last cell thats not empty.
depending on that information i'd be able to decide if a set range fills my page, or if my range is at the end of the xls table (if the range is beyond the rows/columns end it results in an error and the script simply aborts.) "try and catch" to import each single row seperately will take too long for real life xls tables, which have up to 10.000 rows...
Copy link to clipboard
Copied
[moved to InDesign Scripting]
Copy link to clipboard
Copied
Hi,
If you would not specify 'range' property - InDesign will import entire 'filled with data' table (to the last not empty col & row)
If your goal is to know this range before import - you will need to open a Worksheet and exam it using Visual Basic snippet.
It can be done running javascript doScript() method since you would build VB code as a String.
See this post for a details:
load excel spreadsheet to table variable?
Jarek