Hi Team,
Can you please advise me how to run the VBA Macro through SAS 9.4,
Thanks & regards
A Ganesh
DDE. Use google to find examples.
Hi ,
I tried below-mentioned code but I am getting error,
options noxwait noxsync;
x '"C:\Program Files\Microsoft Office\Office\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("c:\temp\test.xlsm")]';
/* Run myVBAmacro */
put '[run("test.xlsm!myVBAmacro")]';
run;
@ganeshsas764 wrote:
Hi ,
I tried below-mentioned code but I am getting error,
When you get errors it really helps to share the actual error. Best is to copy the code submitted with the error and other messages from log and paste into a code box opened using the forum {I} icon. The code box will preserve formatting of error messages.
Note that DDE may be interfered with by other programs that are running on your computer. I know that Cisco Jabber is one and that the process, not just the application window, have to be killed before DDE will work on my computer.
If @PeterClemmensen is right, and you are looking to run VB script from SAS, you can run it by using:
call system(yourVBscript.);
The updated version of the paper that @PeterClemmensen mentioned, which is a SAS macro that both creates and runs VB script, can be found at: http://www.sascommunity.org/wiki/Excelling_to_Another_Level_with_SAS
Art, CEO, AnalystFinder.com
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.