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!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.