Excel with Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello:

Is it possible to execute a macro with command line parameter?

Thanks!
 
Hi Alan

you can put Workbook_Open code against the ThisWorkbook module

(right mouse click on a sheet tab, choose view code ... look for the
workbook name in bold on top left - choose view / project explorer if you
can't see it... under the workbook name you'll see ThisWorkbook - double
click on it ... on drop down on left hand side of white paper on right hand
side of screen choose Workbook .. )

which will fire when the workbook opens (as long as macros are enabled or
security set to low (not recommended)) ... you can then open this workbook
from a command line, e.g.

excel.exe c:\temp\mybook.xls

Hope this helps
Regards
JulieD
 

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

Back
Top