Ah, that's a different issue. There is a bug that I reported a month or so ago. I'm not sure if I reported here, though. Here's how I got around the problem of the no-iteraction flag in the place command not working:
// 1. Import Excel File
var myFile = File.openDialog("Choose an Excel file");
if (myFile == null) { exit() }
if (app.version == 3) {
app.userInteractionLevel = UserInteractionLevels.neverInteract;
} else {
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
}
myDoc = app.documents.add();
setXLimportPrefs();
try {
myDoc.pages[0].place(myFile,[0,0],undefined,false,true);
} catch (e) {
alert (e + " " + app.excelImportPreferences.errorCode);
exit();
}
if (app.version == 3) {
app.userInteractionLevel = UserInteractionLevels.interactWithAll;
} else {
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
}
[snip]
function setXLimportPrefs() {
with (app.excelImportPreferences) {
alignmentStyle = [AlignmentStyleOptions.spreadsheet,
AlignmentStyleOptions.leftAlign,
AlignmentStyleOptions.rightAlign,
AlignmentStyleOptions.centerAlign][0];
//decimalPlaces = 3;
//errorCode = 0;
//preserveGraphics = true; // Not sure what this does either
//rangeName = ""; // Hopefully leaving this blank will cause ranges to be ignored
//sheetIndex = 0;
//sheetName = "";
//showHiddenCells = true;
tableFormatting = [TableFormattingOptions.excelFormattedTable,
TableFormattingOptions.excelUnformattedTable,
TableFormattingOptions.excelUnformattedTabbedText][1];
useTypographersQuotes = true;
//viewName = "";
}
}
As you can see, I ended up commenting out most of the import preferences.
Oh, this is JavaScript, so you'll need to translate.
Dave