How can I re-purpose a Menu Item already added by another Add-in?

David Wilkinson

New member
Joined
Jul 13, 2011
Messages
5
Reaction score
0
Points
0
Location
Sunderland, UK
Hi,

I need to re-purpose a Menu Item that has previously been added by an Add-in.

The problem I am getting is this: All of the Menu Items added by the propriety Add-in have an internal Id of CustomControl. This looks to be the usual behaviour and appears not to be specific to the Add-in.

Therefore when I try to run my own Add-in to override a specific Menu Item, it can't locate it, presumably because they are all have the same name.

I am new to this forum. I would appreciate my suggestions.

Best regards
David Wilkinson
 

Ken Puls

Administrator
Staff member
Joined
Mar 13, 2011
Messages
2,520
Reaction score
5
Points
38
Location
Nanaimo, BC, Canada
Website
www.excelguru.ca
Excel Version(s)
Excel Office 365 Insider
Hi David, and welcome to the forum. :)

Curious, is this a classic addin (xla from Excel 2003 & prior), or a RibbonX addin (xlam from Excel 2007+)
 

David Wilkinson

New member
Joined
Jul 13, 2011
Messages
5
Reaction score
0
Points
0
Location
Sunderland, UK
Hi Ken,

Thanks for getting back to me..

Apologies for not mentioning this, it is a RibbonX Add-in (xlam for Excel 2007).

David Wilkinson
 

Ken Puls

Administrator
Staff member
Joined
Mar 13, 2011
Messages
2,520
Reaction score
5
Points
38
Location
Nanaimo, BC, Canada
Website
www.excelguru.ca
Excel Version(s)
Excel Office 365 Insider
Okay, basically the way it works is this... when two add-ins are opened who have the same xml id, then the one that is opened last (I'm 99% sure it's last) takes precendence. The kicker is that you need the id defined in the xml code, not any of the stuff that you see exposed in VBA.

The difficulty I see is in the way the file opens... if the proprietary addins RibbonX is contained in:
-An xlsm file, then you'll need to load an addin after the xlsm is opened.
-An xlam, then you need to open your xlam afterwards as well. A strategy to do this might be to create a simple addin that you load which checks if the other addin is installed. If it is, load yours (no need to install). If not then either wait, or load the proprietary one first.)

In either case, you should be able to crack the file with the customUI editor to find out the id of the control you want to superscede.

If it's a COM addin though, no you have some challenges. I'm not a VB programmer, so I'm not sure how you would go about tracking down the xml id for the control. Without that, you're not going to be able to take control of it...
 

David Wilkinson

New member
Joined
Jul 13, 2011
Messages
5
Reaction score
0
Points
0
Location
Sunderland, UK
Hi Ken,

Thanks for your reply.

The problem is the proprietary Add-in is a COM Add-in. When I have been testing, the Proprietary COM Add-in has already been applied.

Even if I try to get my Add-in applied when Excel starts, using an Auto_Open event or something similar, I still want the COM Add-in to execute first.

I merely want to modify the action of one of the lower level menu items, not always, but under certain circumstances.

Best regards
David Wilkinson
 

David Wilkinson

New member
Joined
Jul 13, 2011
Messages
5
Reaction score
0
Points
0
Location
Sunderland, UK
To answer your questions..

Hi Dennis,

To answer your first question:

Yes we have a good working relationship with the Company that owns the proprietary software. As far as I know that weren’t aware, until recently, that we have been re-purposing these menu commands.

To answer your second question:

I am upgrading an existing Excel VBA application that runs under Excel 2003 to run under 2007.

The proprietary system I am working with uses a COM Add-in to add two major facilities:

(1) Read, Write and Update web-services facilities to their proprietary SQL Database, which uses VBA to populate and extract information from Excel cells.

(2) For the user to communicate with the proprietary system, the Add-in inserts:

- A new Ribbon group
- Additional menu options on the Office Menu (Or the Office Button as it is sometimes called)

The problem I have concerns the additional menu options added to the Office Menu.

The Add-in adds a Top Level Menu item called “Save to SystemX”. If you select that, you are given two choices: “Save as Format A” or “Save as Format B”.

These are the standard options and by and large are sufficient to fulfill most requirements.

The application I am working on, has some additional code, which checks that a pre-determined list of required fields has been entered before a “Save as Format A” or “Save as Format B” can be executed.

To achieve that in Excel 2003 was fairly standard. The application used the standard methods to modify the “Save as Format A” and “Save as Format B” behavior, to pass control to a procedure which would do the following:

(a) If the required fields are NOT entered, an appropriate message is displayed and the “Save as Format A” or “Save as Format B” is bypassed.

(b) If the required fields are entered, control is passed to the “Save as Format A” or “Save as Format B”.

I hope that helps..

David Wilkinson
 

XL-Dennis

New member
Joined
Mar 21, 2011
Messages
12
Reaction score
0
Points
0
Location
Östersund, Sweden
Website
xldennis.wordpress.com
David,

Sorry for not coming back earlier to You then now.

I have been re-reading the whole thread and there are some aspects that simple point You to go back to the COM add-in vendor and ask them to add the code You now have in the in house add-in.
 

David Wilkinson

New member
Joined
Jul 13, 2011
Messages
5
Reaction score
0
Points
0
Location
Sunderland, UK
XL-Dennis,

Thanks for getting back to me. I will get back to the COM Add-in supplier and ask them to make a change and wait (probably a long time)..

So it looks like the bottom line is this: Once a User Menu item has been added in an instance of Excel 2007 using a COM Add-in, it is not possible to change it..

Anyway, XL-Dennis and Ken thanks for your efforts.

Best regards
David Wilkinson
 
Top