cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
Georg
Level VII

Open Excel File in Excel (Windows standard application) by JSL

Dear all,

my JMP should host a toolbox with also Excel and other files,

so I need to open a file by another application from my Windows system (JMP Pro 15.1, Win10).

Most preferably I would use that standard application that is used by windows explorer, when opening a file.

 

The example below opens the xls in JMP, I would like to open it in Excel, does anyone know how to accomplish that?

Thanks in advance!

Names Default To Here( 1 );

cdt = Open( "$SAMPLE_DATA\Big Class.jmp" );
xls_path = Convert File Path( "$TEMP\Big Class.xls" );
cdt << save as( "$TEMP\Big Class.xls" );

// open file in Excel application, not in JMP, how to ?
open(xls_path, /*Excel Wizard*/);
Georg
2 ACCEPTED SOLUTIONS

Accepted Solutions
Mauro_Gerber
Level IV

Re: Open Excel File in Excel (Windows standard application) by JSL

Be aware to avoid spaces in the file name, otherwise the argument must include "path" in the string (so double")

 

Names Default To Here( 1 );

cdt = Open( "$SAMPLE_DATA\Big Class.jmp" );
xls_path = Convert File Path( "$TEMP\Big_Class.xls" );
cdt << save as( "$TEMP\Big_Class.xls" );

RP = Run Program(
	Executable( "C:\Program Files (x86)\Microsoft Office\Office15\excel.exe"/*path to excel, you may search it in the registration entry of microsoft*/ ),
	Options( {"/r",SUBSTR(xls_path,2)} ),
);

 

 

"I thought about our dilemma, and I came up with a solution that I honestly think works out best for one of both of us"
- GLaDOS

View solution in original post

txnelson
Super User

Re: Open Excel File in Excel (Windows standard application) by JSL

Using the Web() function is a quick and easy way to open an external file in it's assigned application

Names Default To Here( 1 );

cdt = Open( "$SAMPLE_DATA\Big Class.jmp" );
xls_path = Convert File Path( "$TEMP\Big Class.xls" );
cdt << save as( "$TEMP\Big Class.xls" );

web("$TEMP\Big Class.xls");
Jim

View solution in original post

4 REPLIES 4
Mauro_Gerber
Level IV

Re: Open Excel File in Excel (Windows standard application) by JSL

Be aware to avoid spaces in the file name, otherwise the argument must include "path" in the string (so double")

 

Names Default To Here( 1 );

cdt = Open( "$SAMPLE_DATA\Big Class.jmp" );
xls_path = Convert File Path( "$TEMP\Big_Class.xls" );
cdt << save as( "$TEMP\Big_Class.xls" );

RP = Run Program(
	Executable( "C:\Program Files (x86)\Microsoft Office\Office15\excel.exe"/*path to excel, you may search it in the registration entry of microsoft*/ ),
	Options( {"/r",SUBSTR(xls_path,2)} ),
);

 

 

"I thought about our dilemma, and I came up with a solution that I honestly think works out best for one of both of us"
- GLaDOS
txnelson
Super User

Re: Open Excel File in Excel (Windows standard application) by JSL

Using the Web() function is a quick and easy way to open an external file in it's assigned application

Names Default To Here( 1 );

cdt = Open( "$SAMPLE_DATA\Big Class.jmp" );
xls_path = Convert File Path( "$TEMP\Big Class.xls" );
cdt << save as( "$TEMP\Big Class.xls" );

web("$TEMP\Big Class.xls");
Jim
Georg
Level VII

Re: Open Excel File in Excel (Windows standard application) by JSL

Thanks @Mauro_Gerber and @txnelson for the proposals. In my case "run program" did work after some correction of the path string (fileshare starting with // on windows 10), the proposal with "web" did not work, I tried several times, it looks elegant.

I'm not sure, why, couldn't find anything in the log ..., simply no Excel started (Win10, Office16). 

Georg
SeriyGena
Level I

Re: Open Excel File in Excel (Windows standard application) by JSL

Hello, i have similar, but not the same case. I already have the source file in xlsx format, and it includes multiple tabs. 

I would like to have script that opens it as read only or its copy (copy is the best option) in excel.

My version of Win10 and in Win11 the is no option to this:

excel located at C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE

But excel alarm appeared with the meaning, that it can't find the filefile.png

Names Default To Here( 1 );
path="my_excel_file_absulute_path";
RP = Run Program(
	Executable( "C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE"),
	Options( {"/r",path} ),
);