open excel and run a macro from access

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
 
G

Guest

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
 

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