title: How to open and run an excel macro using a batch file
body: <p>I have a batch file that does several things and the last step is to open an excel document and run the macro contained in it which updates the contents of the file. The macro runs perfectly with the click of a button but I want it all to be done when you run the .bat file.</p>
  
  <p>I know I could attach the macro to the open event so it runs when you open the macro but I only want it to update automatically when you run the bat file, not every time you open the thing. </p>
  
  <p>Maybe I could pass a parameter to let it know that it's been run from a .bat? or run it directly with an excel command?</p>
  
  <pre><code>like this?
  run excel.exe /runMacro "mymacro"   
  </code></pre>
  
  <p>I can't find what I need anywhere, thanks.</p>