02-03-2015 08:59 AM
Hi All -
I am trying to automate the steps of process flow which includes SAS and SAS EG tasks(plug-ins) and Excel VBA macros.
Here i would need help to understand how to run a macro which is located in excel file.
Example: sample.xlsm file has the macro with the name 'my_macro' .
I would need to run this in windows command line by using .bat file.
I have done some googling I could not find proper solution.
Thanks in advance!!
02-03-2015 09:29 AM
Proceed as for example described here: http://www.lexjansen.com/pharmasug/2005/CodersCorner/cc21.pdf
Your code could look like:
Filename EXCEL DDE 'EXCEL|SYSTEM';
Filename EXCEL Clear;
02-03-2015 09:33 AM
Do be aware though, user24feb, DDE is old technology, no longer supported by M$. It may/may not work in future, and wouldn't have all the functionality of later (at least 2007/2013 version) releases.
02-03-2015 10:39 AM
My organization has identified at least one application, Cisco Jabber, that will interfere with SAS DDE connections to Excel and other "legacy" software. This can be worked around by killing the process using Task Manager (closing the application leaves a process running). I wouldn't be surprised to find other applications that do the same.
02-03-2015 09:31 AM
You would need to investigate VB scripting. In your VB script you would need to open an office object. Then you can use that object to execute various things which would normally be done within Office applications.
Here are some links to help you however this is out of scope of a SAS forum:
Or from Visual Basic app: