How to place one row from Excel at a time?
Hello everyone,
Actually the topic should be "How to set Excel import preferences?", but I am hesitant to change the old topic.
The problem is that app.excelImportPreferences doesn't define the import preferences. The code ignores the setting of the Excel import preferences and uses previous preferences from InDesign. I tried changing the table formatting from InDesign. I have tried app.excelImportPreferences.rangeName = "A3:H3";.
Below the code. Help appreciated!
Greetings,
bgfrhlp
P.S. I have tried to locate help from the forum and the internet, with no success.
doc = app.open(filePath = "d:/base.indt");
newFrame = doc.textFrames.add({geometricBounds:[6,28,37,84]});
setExcelImportPrefs ();
excelFile = new File ("d/file.xlsx");
newFrame.place (excelFile);
function setExcelImportPrefs(){
with(app.excelImportPreferences){
alignmentStyle = AlignmentStyleOptions.spreadsheet;
decimalPlaces = 4;
preserveGraphics = true;
//Enter the range you want to import as "start cell:end cell".
rangeName = "A3:H3";
sheetIndex = 1;
showHiddenCells = false;
tableFormatting = TableFormattingOptions.excelFormattedTable;
useTypographersQuotes = false;
viewName = "";
}
}
Message was edited by: bgfrhlp