Hello There,
I am attempting to open up an excel document using an x command. I am currently not getting any errors, the code is running to completion, however, nothing is happening upon completion of the code.
The document lives on a shared directory, and is in a virtual environment. We are not sure if either of these are causing the issue. Other x commands are functioning (creating or deleting items), so we can at least confirm that the xcmd functionality is working.
Any recommendations would be highly appreciated.
Thanks!
Code used below:
proc options option=xcmd; run;
options noxwait noxsync;
x '"directory\x_experiments\DelimitedExample"';
As long as you are logging on to a Windows session on your virtual PC, then running SAS within this session then opening an Excel session should work. In essence Excel needs a display, virtual or real, to successfully start. No display, no Excel. This is different from using SAS to read or write Excel workbooks. In this case you aren't using Excel sessions.
Howdy!
the file name is included (DelimitedExample). I had seen the extension left off in other threads, so I had left it off in my experiments to get it to work.
playing around with the command prompt now to try and get it to work in a different file first. would I be using .exe or .xlsx?
thank you!
Where is your SAS program running? This will only work if it is running on your PC. If the program is running on a remote SAS server, then you can't start a local Excel session from there.
okay, that may unfortunately be (one of) the issues. Our system is running on a virtual environment and not on the main computer.
as noted earlier, other x commands are working correctly (creating or destroying folders and txt documents), is there a way to tell which x commands would or would not work on a virtual environment?
that is fine, I don't need to open anything on the local machine, im trying to open a document that also lives in the virtual environment.
As long as you are logging on to a Windows session on your virtual PC, then running SAS within this session then opening an Excel session should work. In essence Excel needs a display, virtual or real, to successfully start. No display, no Excel. This is different from using SAS to read or write Excel workbooks. In this case you aren't using Excel sessions.
thank you!
I will continue to play around with it and return if I am still having issues.
excel is installed, this is being run on windows, not unix. what would you change in the formatting?
thanks!
FWIW when I run
x 'x:\data\junk.xlsx';
the desired file opens. This is running SAS locally on a Windows10 machine.
No file extension, i.e. the XLSX part and the only thing that happens is a command prompt window opening.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: