A
Amir
Hi!
I'm trying to run an Excel Addin which is password protected and therefore I
cannot have it's code.
I'm able to run the main procedure from Excel, by:
Application.Run "Main_Procedure_Name"
(I know the main procedure name)
The problem is that if I try to run this code from Word, by defining an
Excel object (named XLApp), and running the following command:
XLApp.Run "Main_Procedure_Name", It cannot find the procedure.
It's weird because problem is solved if I move the Addin control to the main
command bar, and runs the following command instead of XLAPP.Run
"Main_Procedure_Name":
XLApp.CommandBars("Worksheet Menu
Bar").Controls("MyAddinControlCaption").Execute.
(Replacing "MyAddinControlCaption" with the real caption of the addin
button.)
Therefore it seems that it's not a problem with my Excel object definition,
or something, but I have no explanation why it can find the procedure when
it's executed when Excel is opened regularely (not by Word macro), but it
can't find it (though able to activate it using a control) when it's
executed by Word Macro.
Macro works fine using the solution of moving the Addin control to the main
control bar and using the XLApp.CommandBars.....Execute command, but I don't
want to move the Addin control to the main command bar in each of the
computers I wish to install the macro on..
Kind Regards,
Amir.
I'm trying to run an Excel Addin which is password protected and therefore I
cannot have it's code.
I'm able to run the main procedure from Excel, by:
Application.Run "Main_Procedure_Name"
(I know the main procedure name)
The problem is that if I try to run this code from Word, by defining an
Excel object (named XLApp), and running the following command:
XLApp.Run "Main_Procedure_Name", It cannot find the procedure.
It's weird because problem is solved if I move the Addin control to the main
command bar, and runs the following command instead of XLAPP.Run
"Main_Procedure_Name":
XLApp.CommandBars("Worksheet Menu
Bar").Controls("MyAddinControlCaption").Execute.
(Replacing "MyAddinControlCaption" with the real caption of the addin
button.)
Therefore it seems that it's not a problem with my Excel object definition,
or something, but I have no explanation why it can find the procedure when
it's executed when Excel is opened regularely (not by Word macro), but it
can't find it (though able to activate it using a control) when it's
executed by Word Macro.
Macro works fine using the solution of moving the Addin control to the main
control bar and using the XLApp.CommandBars.....Execute command, but I don't
want to move the Addin control to the main command bar in each of the
computers I wish to install the macro on..
Kind Regards,
Amir.