Search code examples
xmlexcelribbonexcel-2013vba

Is there a way in Excel 2013 to specify a key or key combination (A keytip!) to be used to in conjunction with 'Alt' to select a ribbon tab in excel?


I have a workbook in use by a number of users. For various reasons, some have more tabs in the ribbon when they open up my workbook than others, and when the workbook is opened and a user presses Alt, the corresponding key press associated with my custom ribbon tab will not always be the same.

enter image description here

Can I, for example, edit my XLSM file's XML so that the key pressed in conjunction with Alt will always be the same? I would like a solution that will work in excel 2013 (although it would be a bonus if it also worked in 2010 and/or 2007)

I have not been very successful in my search for a solution BUT eventually found HALF an answer. Apparently you add keytip="Z" or whatever in the customUI xml.

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon startFromScratch="false">
    <tabs>
      <tab id="MyCustomRibbonTab" label="TEAM" keytip="Z">         
      </tab>
    </tabs>
  </ribbon>
</customUI>

I was then able to find this (How to set keytip on a ribbon?) retrospectively once I knew the correct terminology.

Trouble is it doesn't appear to work in 2013.


Solution

  • It turn's out that certain keys or key combinations just weren't going to work for me (I think). I have no idea why and if anyone can provide a better explanation detailing what works/doesn't and why I'll mark it correct, BUT in the mean time, I got this to work by changing the keytip to la rather than Z or LA. I'd be interested to know if this is just me...

    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
      <ribbon startFromScratch="false">
        <tabs>
          <tab id="MyCustomRibbonTab" label="TEAM" keytip="la">         
          </tab>
        </tabs>
      </ribbon>
    </customUI>