Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Managing Add-Ins
Thanks in advance for any help or ideas.....
I have two add-ins that I use to query external data sources. I can't have both loaded in Excel at the same time because they share the menu bar name and I can't change either of the names. Half of the time I want to have one add-in loaded in Excel, the rest of the time I want the other one loaded. My goal is to create an add-in I can send to users that allows them to click a button on a custom toolbar and switch the loaded add-in to the one they want. I used the following code as an example: ' Remove DataSource1 add-in AddIns("DataSource1 Server DLL").Installed = False ' Load DataSource2 add-in AddIns("DataSource2 Server DLL").Installed = True (and vice versa). The problem is that when I use the toolbar to load and unload the add-ins I get an error when I try to use the menubar of a loaded add-in. For example: MANAGE_ADDIN.XLA creates the custom toolbar with the buttons that loads and unloads add-ins. DATASOURCE_ADDIN1 is one of the add-ins that I use to query external data. I can unload and load add-ins easily with this XLA file. If I select an item on the menubar of the add-in I just loaded it gives me the following error: The macro "MANAGE_ADDIN.XLA'!do_something" cannot be found." The do_something macro is stored in DATASOURCE_ADDIN1 and not MANAGE_ADDIN. Is there a way to tell excel to look in the correct add-in without changing the menu of the DATASOURCE_ADDIN itself? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Managing Add-Ins
Typically add-ins create their own menus when they open and delete them went
they close. It doesn't sound like that's what you're doing because I don't think you'd have this problem if they did. Since you say that one add-in is always open then I suppose you could not have the add-in remove the menu when it closes and then have the opening add-in assign its macros to the existing menuitems using the OnAction property. Each add-in should check whether the menu already exists (since it wouldn't on a new system) and create it if necessary. So your switcher add-in would do little more than close one add-in and open the other and let each add-in handle assigning its macros to the menuitems. -- Jim wrote in message oups.com... | Thanks in advance for any help or ideas..... | | I have two add-ins that I use to query external data sources. I can't | have both loaded in Excel at the same time because they share the menu | bar name and I can't change either of the names. | | Half of the time I want to have one add-in loaded in Excel, the rest of | the time I want the other one loaded. | | My goal is to create an add-in I can send to users that allows them to | click a button on a custom toolbar and switch the loaded add-in to the | one they want. | | I used the following code as an example: | ' Remove DataSource1 add-in | AddIns("DataSource1 Server DLL").Installed = False | ' Load DataSource2 add-in | AddIns("DataSource2 Server DLL").Installed = True | (and vice versa). | | The problem is that when I use the toolbar to load and unload the | add-ins I get an error when I try to use the menubar of a loaded | add-in. | | For example: | MANAGE_ADDIN.XLA creates the custom toolbar with the buttons that loads | and unloads add-ins. | DATASOURCE_ADDIN1 is one of the add-ins that I use to query external | data. | | I can unload and load add-ins easily with this XLA file. | | If I select an item on the menubar of the add-in I just loaded it gives | me the following error: | The macro "MANAGE_ADDIN.XLA'!do_something" cannot be found." | | The do_something macro is stored in DATASOURCE_ADDIN1 and not | MANAGE_ADDIN. | | Is there a way to tell excel to look in the correct add-in without | changing the menu of the DATASOURCE_ADDIN itself? | | Thanks. | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Managing bad data | Excel Discussion (Misc queries) | |||
Managing menus via VBA | Excel Programming | |||
Managing a big report | Excel Discussion (Misc queries) | |||
Managing User Changes | Excel Programming | |||
MANAGING MACROS | Excel Programming |