How to identify variable workbooks in an excel Addin
Jim
Thanks for all your efforts.
Martin
"Jim Cone" wrote:
Martin,
I am out of ideas.
Regards,
Jim Cone
"Martin in Frisco Texas"
wrote in message
Jim
I checked and the "IsAddin" is set to true.
Martin
"Jim Cone" wrote:
Martin,
In the VisualBasicEditor (VBE) Project window (Ctrl +R), select "ThisWorkbook" in the
add-in workbook project.
In the Properties window (F4), the "IsAddin" property should be set to True.
If this is done the workbook will not be visible and should never become "active".
Regards,
Jim Cone
"Martin in Frisco Texas"
wrote in message
...
Jim
Thanks once more.
I have been using the syntax as you suggested.
I have discovered that once the Addin is installed, the activeworkbook
becomes the addin and remains the addin until the Auto_Open sub is finished.
Then the activeworkbook becomes the (nonaddin) workbook. This is why the sub
reacts differently depending upon if they are run from the Auto_Open sub or
run from menu.
I am thinking about using an If statement depending upon which workbook is
the activeworkbook. This way I can write different subs to run each way.
Hope you have a better idea.
I appreciate all the attention you have given my problem.
Martin
"Jim Cone" wrote:
Martin,
To call a macro in an add-in you can use the following syntax...
Application.Run "YourAdd-in.xla!YourSubName"
If there are arguments required for the sub then...
Application.Run "YourAdd-in.xla!YourSubName", Arg1, Arg2
Note the exclamation point !
Regards,
Jim Cone
|