Hi. I'm noticing that if I try to open an excel file using a script, the Excel Import Wizard appears if the Open command originates from a buttonbox, but it does not appear if the Open command is in the top-level of the script. For the record, I do not want the wizard to appear in this case. Is anyone familiar with this behavior, and if so, can I fix it?
For example, I have a script where the user picks an excel file, then it opens. In this case the excel file opens as a JMP table without issue. However, if instead I place the command to open the excel file within a buttonbox, the Excel Wizard appears. Even if using the exact same options in both cases. This is demonstrated in the script below, using the attached xlsx file:
Names Default to Here(1);
//Get location of file:
path = Pick File("Select xlsx Table...",,
{"Excel|xlsx"}, 1,
0
);
If(path == "", Stop());
//Expression to open file:
open_exp = Expr(
Open(path,
Worksheets("Sheet1"),
Use for all sheets(1),
Concatenate Worksheets(0),
Create Concatenation Column(0),
Worksheet Settings(
1,
Has Column Headers(1),
Number of Rows in Headers(1),
Headers Start on Row(1),
Data Starts on Row(2),
Data Starts on Column(1),
Data Ends on Row(0),
Data Ends on Column(0),
Replicated Spanned Rows(0),
Replicated Spanned Headers(0),
Suppress Hidden Rows(1),
Suppress Hidden Columns(1),
Suppress Empty Columns(1),
Treat as Hierarchy(0),
Multiple Series Stack(0),
Import Cell Colors(0),
Limit Column Detect(1),
Column Separator String("-")
)
);
);
//Attempt to open file...works as intended (no Import Wizard)
open_exp;
//Attempt to open file via a button...always results in the Import Wizard.
win = New Window("Temp",
ButtonBox("Open xlsx",
open_exp
)
);
As you can see, both methods are using the exact same command with the exact same options on the exact same file, yet I'm getting 2 different behaviors.
Of further note, when the xlsx file is opened via the buttonbox, the open command settings seem to be ignored. That is, if I alter the "Number of Rows in Headers", "Headers Start on Row", "Data Starts on Row", etc options, the first method used will respect those new settings. However the second "buttonbox" method with the Import Wizard always seems to revert to the default settings instead.
For the record, I don't want to modify my preferences so that JMP never uses the Excel Wizard. I just don't want to use it in this case, and I can't require other users of this app to make the same mods to their preferences.
My specifics:
JMP Pro 15.2.1
Mac OS Catalina 10.15.7
Excel: Version 16.49
Hope someone can help. Thanks!