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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run macro from batch file 1

Status
Not open for further replies.

sarahnice

Technical User
Nov 18, 2002
101
0
0
IE
Is there any way to run a macro created in excel from a batch file?

Tanx

:)
 
Sarahnice,

yep, there sure is, put your macro into the workbook_open private sub (this way it'll run as soon as the workbook opens), then put into your batch file the command to start excel and the workbook, I dont know what kind of batch file you're talking about (more info next time would help a lot)but the kind of command you need is as simple as:
c:\program files\microsoft office\office\excel.exe c:\mypath\myworkbook.xls

this should start excel and the workbook, if you're talking a unix batch then you'll need a different command and I haven't done that stuff in a while so cant help you sorry...

hope this helps

Kaah.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top