excel macro excecution from command line via bat file?

T

Ted

Is there a way to open an excel workbook and launch a macro from
within a BAT file? I know this can be done with access as seen in the
example below.
______________________________________________________________________________
"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE" "\
\brsrv001\vol2\SHARED.DOC\backlog\DG_Capacity.mdb" /nostartup /x
WeeklyUpdate

Exit
______________________________________________________________________________

Is there a similiar option for excel?
 
T

Ted

Is there a way to open an excel workbook and launch a macro from
within a BAT file? I know this can be done with access as seen in the
example below.
___________________________________________________________________________­___
"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE" "\
\brsrv001\vol2\SHARED.DOC\backlog\DG_Capacity.mdb" /nostartup /x
WeeklyUpdate

Exit
___________________________________________________________________________­___

Is there a similiar option for excel?

Never mind the previous, instead, how do i setup a default macro to
run when a particular workbook is open?
 
G

Gord Dibben

Ted

Private Sub Workbook_Open()
macroname or code goes here
End Sub

Entered in Thisworkbook module.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top