Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to run VBA macro from batch file

Status
Not open for further replies.

yarondavid

Programmer
May 8, 2006
20
IL
Hi
I want to know how to run a VBA macro from batch file

The following code in batch file does't work:

cd c:\Program Files\Microsoft Office2003\OFFICE11\
excel.exe "G:\Pss\C-env_tests_CPSS_APIs_coverage.xls"

Thanks
 
If you mean 'bat' (dos) files, you can open excel file with either:
1. (create new excel instance):
start excel.exe G:\Pss\C-env_tests_CPSS_APIs_coverage.xls
or:
2. (use, if present, existing instance otherwise create new one):
start G:\Pss\C-env_tests_CPSS_APIs_coverage.xls
There is no need to change directory, the system knows how to find excel.

I doubt if it is possible to run macro automatically this way. VB scripts are much more flexible.


combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top