open excel and run a macro from access

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

Guest

How do I open excel and run a macro from access. I knoe to use the RunApp
action but not sure of the command line to include the excel macro. The
Excel macro name is copycells. Below opens the excel file but does not
excecute the macro

"c:\program files\microsoft office\office\excel.exe" "c:\organic.xls"
copycells

Thanks
 
Eric, try renaming the macro Sub Auto_Open in your Excel file organic.xls.
This will cause it to run every time you open the file (hold down 'Shift' if
you do not want the macro to run when you manually open the file).
If you want to be able to use the file without the 'Auto Run' feature you
might make a copy with the macro like it is now for that use and not have to
remember to hold down the 'Shift' key.
Hope this helps.

dave
 
Back
Top