Assigning Macro in another workbook

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

Hey

The below part of my code assigns the macro "ImportData"
to my menu item that I have created. I would like for it
to assign that macro "ImportData" but the macro is loacted
in Workbook ImportData. What is the code to make it
assign this macro from that workbook?


ctrlButton.OnAction = "ImportData"

Thank you

Todd Htutenstine
 
If the ImportData Workbook is closed:

..OnAction = "c:\my documents\excel\Importdata.xls" & "!module1.importdata"

(the module1. stuff is only required if you have non-unique procedure names in
different modules.)

and if it's open:
..OnAction = "importdata.xls!module1.importdata"
 

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