Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

addin-dilemma

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
I have an addin that creates a menu. when you select a menu item it executes code that is also stored in the add-in...however there is a problem if the addin sub has the same name as a macro in the activeworkbook. I have tried to get around this but cant, when i create the menu i say
.onaction = thisworkbook.name & "!macro1"

but if the workbook has a macro called "macro1" also, it will execute that macro and not the addin code,
why is that even when i explicity say thisworkbook.name?
thanks!!!
 
Don't really know the answer to your question - I have found that setting property values with code that includes an operator gives strange problems at times.

1. Could try using a string variable eg.
MyMacro = thisworkbook.name & "!macro1"

2. With the infinity of possible macro names it should be easy to find some unique ones. 'Find and Replace' should not take more than a minute or two.


Regards
BrianB
Use CupOfCoffee to speed up all windows applications
================================
 
Change VBA project name from standard 'VBAProject' to something specific, say 'MyProject'. Next use it as a path (library) to the macro:
.onaction = "MyProject.macro1"

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top