I have following code which I have been running for couple months in my daily job. But since yesterday it stopped working. It opens the excel file and then it does not do anything (not running the VBA macro at all). Below is my code. Please let me know if any settings need to be changed...
Below is my code:
%let macDrv=c:\Temp\Reports;
%let macBook=Macro_Format_Scorecard.xlsm;
%let macName=FormatAllReports;
filename exl dde 'excel|system';
options noxwait noxsync;
x "'C:\Program Files\Microsoft Office\Office15\EXCEL.EXE' &macDrv.\&macBook";
data _NULL_;
x=sleep(5);
run;
data _null_;
file exl;
put '[RUN("'"&macBook"'!'"&macName"'",FALSE)]';
put '[ERROR(FALSE)]';
put '[SAVE()]';
put '[CLOSE()]';
run;
data _null_;
file exl;
put '[QUIT()]';
run;
If it stopped working and worked before it's likely not the code.
Verify that nothing else has changed, permissions, SAS settings, security settings, version of Excel, and path of file.
Thanks Reeza.
If I run VBA macro, then it works. It formats the Report. But when I let SAS run the Same Madcro, it does not work..
SAS called macro fine previously with this code and doesn't now? Is that correct?
If so, something else is the issue.
Figure out what changed between last run and this and test each change.
Yes, SAS code worked perfectly until yesterday..
I have found at least one other application, Cisco Jabber, that if running interferes with dde calls and have anecdotal evidence there may be others. In the case of Jabber it is not sufficient to stop running the program but you have to use task manager to kill the process.
So you may check with your IT folks about any new or updated program installed since the last time you successfully ran the SAS program.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.