cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
anna_717
Level II

Open file in excel with whitespace in filename

Hi,

Is it possible to open an Excel file from JMP where there is whitespace in the filename or path?

Code from this post works where there is no whitespace:

Solved: Open Excel File in Excel (Windows standard application) by JSL - JMP User Community

 
 
excel_file_to_open = Concat( "/X:/folder location/",excel_file_new_name);
RP = Run Program(
Executable( "C:\Program Files\Microsoft Office\root\Office16\excel.exe" ),
Options( {"/r",SUBSTR(excel_file_to_open,2)} )
);
 

Unfortunately I can't use web() to open the file as this seems to be clashing with another application and causing an error.

Any help appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Open file in excel with whitespace in filename

Something like this might work (convert file path + escaped quotes)

Names Default To Here(1);

excel_file_to_open = Convert File Path("$DOWNLOADS\New folder (3)\sauna2.xlsx", "windows");

RP = Run Program(
	Executable("C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE"),
	Options( {"/r","\!""||excel_file_to_open|| "\!""} )
);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Open file in excel with whitespace in filename

Something like this might work (convert file path + escaped quotes)

Names Default To Here(1);

excel_file_to_open = Convert File Path("$DOWNLOADS\New folder (3)\sauna2.xlsx", "windows");

RP = Run Program(
	Executable("C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE"),
	Options( {"/r","\!""||excel_file_to_open|| "\!""} )
);
-Jarmo
anna_717
Level II

Re: Open file in excel with whitespace in filename

Thanks for your help

Recommended Articles