Hi, i want to use SAS to run a macro in a excel .xlsm file. I read this useful guide:
but i've a problem to use the filename "excel|system" option.
The code is:
options noxwait noxsync;
x '"C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE" ';
/* Sleep for 5 seconds to give Excel time to come up */
data _null_;
x=sleep(5);
run;
filename cmds dde "excel|system";
data _null_;
file cmds;
/* Open the excel file test.xlsm which contains the VBA macro */
put '[open("X:\temp\test.xlsm")]';
/* Run myVBAmacro */
put '[run("test.xlsm!myVBAmacro")]';
run;When i run a program the log give back this error:
ERROR: Physical file does not exist, excel|system.
What is wrong?
Thanks for the support
Thank you for the reply!
I didn't understand the log from the code submitted for XCMD... 😞
The log is:
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
21
22 GOPTIONS ACCESSIBLE;
23 proc options
24 option=xcmd;
25 run;
SAS (r) Proprietary Software Release 9.4 TS1M2
XCMD Enables the X command in SAS.
NOTE: PROCEDURE OPTIONS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
26
27 GOPTIONS NOACCESSIBLE;
28 %LET _CLIENTTASKLABEL=;
29 %LET _CLIENTPROJECTPATH=;
30 %LET _CLIENTPROJECTNAME=;
31 %LET _SASPROGRAMFILE=;
32
33 ;*';*";*/;quit;run;
34 ODS _ALL_ CLOSE;
35
36
37 QUIT; RUN;it's enable?
Sorry!
Probably SAS run on server, because for starting the process we wait the connection to the server SAS App. It's possible?
Sorry for my ignorance and thank you for your support!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.