+ Reply to Thread
Results 1 to 11 of 11

customUI.xml disables my comaddin

  1. #1
    Registered User
    Join Date
    02-06-2012
    Location
    Maastricht
    MS-Off Ver
    Excel 2007
    Posts
    16

    Question customUI.xml disables my comaddin

    Hi,

    I have received an excel file from a collegue with a customUI.xml in it which removes all functionality from the ribbon, including the comaddins.
    When we normally - without this customUI.xml in it - click on the office button on the top-left, we have an extra menu called "Save to XXX", which shows us three buttons 3x "Save to XXX As YYY".
    Normally this works fine.
    But, using the customUI.xml, the whole "Save to XXX" is gone.
    I've browsed through the customUI.xml on how to re-enable it, but I don't know how.
    I know it's a COMAddin. I just don't know the xml-code to display this menu on the ribbon-officemenu

    <!-- Set startFromScratch to true to hide the Ribbon and QAT -->
    <ribbon startFromScratch="true">

    <!-- startFromScratch="true" hides all of the Ribbon tabs and it hide the QAT. -->
    <!-- It also hides most of the commands on the Office Button menu, but for -->
    <!-- some reason, it does not hide the 'New', 'Open' and 'Save' commands. -->
    <!-- Also it not hides the Contextual tabs on the ribbon, for example the -->
    <!-- Format tab that you see when you select a picture on your worksheet. -->
    <!-- So if you want to hide them you must use the RibbonX below: -->

    <officeMenu>
    <button idMso="FileNew" visible="false" />
    <button idMso="FileOpen" visible="false" />
    <button idMso="FileSave" visible="false" />
    <!-- I WANT TO ADD A LINE HERE TO MAKE THE COMAddIn VISIBLE -->
    <!-- In VBA I've got the COMAddIn as an object, and I see a propertie called GUID and ProgID -->
    </officeMenu>


    Can anyone help me with this issue?

    <menu idQ="???" visible="true" />

    or

    <menu id="???" visible="true" />

    I don't know what to use for ???, i tried GUID and ProgID, for both idQ and id, none seem to work.


    Thanks.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: customUI.xml disables my comaddin

    I don't reckon you can unless you know how the COM addin is using the ribbon. you could probably just change
    <button idMso="FileSave" visible="false" />
    to
    <button idMso="FileSave" visible="true" />
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    02-06-2012
    Location
    Maastricht
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: customUI.xml disables my comaddin

    Hi JosephP,

    Your suggestion is not sufficient, as I need the COMAddIn's functionality.
    It saves the file to our server-application and it's processed, not only saving a file to right location.

    It's really bugging me.

    I checked on Excel 2010 and there the line:

    <menu id="COMAddIn.ProgId goes here" visible="true" />

    works, but on Excel 2007 it doesn't work [stupid 2007 :P]

    Do you - or somebody else - know a solution?

    Thanks!

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: customUI.xml disables my comaddin

    did you try my suggestion? I assume that the COM addin adds a button inside the Save menu which you are hiding at the moment. if you show the menu the button may well be there

  5. #5
    Registered User
    Join Date
    02-06-2012
    Location
    Maastricht
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: customUI.xml disables my comaddin

    Hi JosephP,

    I've tested that combination of setting the FileSave visibility to true together with my line of code.
    It then shows the save button (as expected, because i've set it to true).
    But it shows the placeholder for the "Save to XXX".
    I strongly feel they aren't connected, because the placeholder also appears with FileSave's visibility set to false.

    I do however have a new theory about 2010 working and 2007 not:
    In 2007 I don't have anything in the dropdown when I click on the office button in the top-left, except for Recently Opened documents.
    In 2010 I have every item in it, it seems to me that the whole officeMenu is not affected by the customUI.xml (2007).
    Therefore, I have the COMAddIn working...

    It's really annoying, because I can't find it anywhere on the internet.
    My best hope is that anyone reads this post and posts their ideas.

    I'm really happy that you answered so quickly JosephP, and I value your responses.
    It didn't solve my problem yet, but we'll get there...

    I understand my situation is not easy to reproduce, but as you may understand, I cannot distribute my COMAddIn as it is Company owned.
    I greatly appreciate any further feedback from you but also welcome anybody with a thought/possible solution.

    Thanks,

    Percy

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: customUI.xml disables my comaddin

    I'm lost as to what your situation actually is so I reckon some screenshots might help. Initially you said
    But, using the customUI.xml, the whole "Save to XXX" is gone.
    but now you say
    But it shows the placeholder for the "Save to XXX".
    I strongly feel they aren't connected, because the placeholder also appears with FileSave's visibility set to false.
    so I'm not sure what is or isn't appearing and where.

    since there isn't an Office menu in 2010 which has the Backstage view instead it wouldn't be affected.

  7. #7
    Registered User
    Join Date
    02-06-2012
    Location
    Maastricht
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: customUI.xml disables my comaddin

    I will explain to you in more detail.

    I have an excel .xlsm file. A collegue of mine used the Custom UI Editor for MS Office to add a customUI.xml for office 2007.
    In that xml file, he uses startfromscratch="true" to disable everything in the ribbon, including the officemenu (the officemenu is the menu you get when you click on the office logo in the top-left).

    When I open this xlsm file in Office 2007, indeed all items from the ribbon AND the officemenu have disappeared, except for the standard functions he specified to be visible. My collegue also added some custom buttons, togglebuttons etc. to the ribbon, which call a VBA function. This all works fine, no problems.

    The problem lies in the fact that the startfromscratch="true" hides everything from the ribbon/officemenu. Our company COMAddIn puts a menu in the officemenu which has 3 buttons. I will describe this some more:
    - The name of our custom menu in the officemenu is: "Save to XXX"
    - When you click on it, you get a page where you can select 1 of the 3 possible buttons
    - Save to "XXX" As a ...
    - Save to "XXX" As a ...
    - Save to "XXX" As a ...

    This custom menu inside the officemenu is hidden through the use of startfromscratch="true". I confirmed that the COMAddIn is loaded. I checked the registry and the LoadBehavior is set to 3 (Load at Startup). I checked using VBA if the COMAddIn is connected.
    The code I used for this is:
    Application.COMAddIns("OurCOMAddIn.ProgId goes here").Connect = True
    Actual, I have some more code in there to check if it's connected, debug.print some stuff, but this doesn't seem to get me any further.

    In the customUI.xml I've added this line within the <officemenu>...</officemenu> block:

    <menu id="OurCOMAddIn.ProgId goes here" visible="true" />

    When I add this line, I see something in the officemenu of 2007. The button is not there, but I do see an arrow pointing to the right. I recognize this arrow as the arrow there normally would be for a menu in the officemenu.

    The fact I see this "placeholder" tells me I'm close, but I don't know how to get it working. It frustrates me this is so difficult to achieve.

    I've also considered the alternative: setting startfromscratch="false" and disabling every single standard item from the ribbon and officemenu. Because this will be an enormous big list of things to disable and takes a lot of time (although I have found an excel file listing all idMso's of all standard items in Excel). I rather use the startfromscratch="true" and make the COMAddIn visible in the 2007 officemenu.

    I know that for Office 2010 the officemenu is unaffected by the customUI.xml file. My collegue is aware of this and is working on a backstage version to also hide all items from the backstage (of course except for the COMAddIn).

    I hope the above explains my situation in some more detail and maybe you can help me further.

    I really appreciate your feedback. Again, my thanks!

    Percy

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: customUI.xml disables my comaddin

    if you leave the startfromscratch set to true but make all the menu buttons visible, does the COM add-in button reappear properly? (I'm wondering whether trying to load before an invisible control is causing problems)

  9. #9
    Registered User
    Join Date
    02-06-2012
    Location
    Maastricht
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: customUI.xml disables my comaddin

    Hi JosephP,

    I've thought about that earlier today.

    I've made FileNew, FileOpen, FileSave visible and put my line in there

    <menu id="COMAddIn.ProgID goes here" visible="true" insertAfterMso="FileNew" />

    Now the "placeholder" is in between two working ones.
    I feel I'm so close, but still so far away...

    Thanks for your quick response!

  10. #10
    Registered User
    Join Date
    02-06-2012
    Location
    Maastricht
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: customUI.xml disables my comaddin

    Here's a screenshot I was able to make... for illustration purposes.
    screenshot.JPG

  11. #11
    Registered User
    Join Date
    02-06-2012
    Location
    Maastricht
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: customUI.xml disables my comaddin

    Here's a screenshot when I've set startfromscratch="false"
    screenshot2.JPG

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1