- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Team,
Can you please advise me how to run the VBA Macro through SAS 9.4,
Thanks & regards
A Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
But I want only execute the VBA macro, no need to export any data to excel
file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
DDE. Use google to find examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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