Assigning Macro in another workbook

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
 
D

Dave Peterson

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"
 
Top