Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Managing bad data hasn7 Excel Discussion (Misc queries) 2 May 18th 06 10:53 PM
Managing menus via VBA mddawson - ExcelForums.com Excel Programming 3 June 6th 05 04:08 PM
Managing a big report nbeaird Excel Discussion (Misc queries) 0 March 16th 05 03:25 PM
Managing User Changes Peter[_44_] Excel Programming 1 August 9th 04 12:12 PM
MANAGING MACROS angie Excel Programming 1 February 11th 04 09:36 AM


All times are GMT +1. The time now is 06:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"