Results 1 to 10 of 10

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

  1. #1
    Seeker David Wilkinson's Avatar
    Join Date
    Jul 2011
    Location
    Sunderland, UK
    Posts
    5
    Articles
    0

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



    Register for a FREE account, and/
    or Log in to avoid these ads!

    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

  2. #2
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,076
    Articles
    79
    Blog Entries
    14
    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+)
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Master your data with Power Query: Purchase your copy of my book M is for Data Monkey today!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  3. #3
    Seeker David Wilkinson's Avatar
    Join Date
    Jul 2011
    Location
    Sunderland, UK
    Posts
    5
    Articles
    0
    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

  4. #4
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,076
    Articles
    79
    Blog Entries
    14
    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...
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Master your data with Power Query: Purchase your copy of my book M is for Data Monkey today!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  5. #5
    Seeker David Wilkinson's Avatar
    Join Date
    Jul 2011
    Location
    Sunderland, UK
    Posts
    5
    Articles
    0
    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

  6. #6
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,076
    Articles
    79
    Blog Entries
    14
    Hmmm... as soon as we got to COM, I'm stuck here. Let me see if I can call in some help...
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Master your data with Power Query: Purchase your copy of my book M is for Data Monkey today!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  7. #7
    Seeker XL-Dennis's Avatar
    Join Date
    Mar 2011
    Location
    Östersund, Sweden
    Posts
    12
    Articles
    0
    David,

    The COM add-in You refer to, do You know who has created the COM add-in?

    When You say certain circumstances what exactly do You refer to?

    [Edit note] Yes, I'm the one that Ken called.
    Kind regards,
    Dennis

    .NET & Excel | 2nd edition PED | MVP

  8. #8
    Seeker David Wilkinson's Avatar
    Join Date
    Jul 2011
    Location
    Sunderland, UK
    Posts
    5
    Articles
    0

    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

  9. #9
    Seeker XL-Dennis's Avatar
    Join Date
    Mar 2011
    Location
    Östersund, Sweden
    Posts
    12
    Articles
    0
    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.
    Kind regards,
    Dennis

    .NET & Excel | 2nd edition PED | MVP

  10. #10
    Seeker David Wilkinson's Avatar
    Join Date
    Jul 2011
    Location
    Sunderland, UK
    Posts
    5
    Articles
    0
    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •