Solved

Excel 2010 amend file Tab ribbon

Posted on 2012-04-11
5
1,207 Views
Last Modified: 2012-04-12
Hi Experts

I have a spreadhsheet which I have created a custom ribbon tab - using the custom UI editor, I have disabled all other ribbon tabs, but the file tab  is still present and active - im guessing this is mandatory - is there a way I can use VBA or the custom UI to edit what commands are in the file tab, I dont want the save or open command avaiable.
0
Comment
Question by:MrDavidThorn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 42

Expert Comment

by:dlmille
ID: 37834852
You are correct.  The FILE tab is like the old Office button.

However, Ron's got some good times to handle exactly what you need, re: backstage:

http://www.rondebruin.nl/backstage.htm

Dave
0
 

Author Comment

by:MrDavidThorn
ID: 37836202
Thanks,

I have 'pinched'  some of the backstage code XML however I dont know where to put it on my exsisting code - the below isnt working

<customUI onLoad="RibbonOnLoad"  xmlns="http://schemas.microsoft.com/office/2006/01/customui">

  <ribbon startFromScratch="true">
    <tabs>
      <backstage>
                         <button idMso="FileSave" visible="false"/>
                 </backstage>

      <tab id="MyCustomTab" label="Investec Nav" insertAfterMso="TabHome" getVisible="GetVisible" tag="rNAV">
                        
          <group id="customGroup1" label="Tracker">
          <button id="customButton1" label="Add/Update Fund Benchmark" size="large" onAction="psLoadBenchMark" imageMso="AdpDiagramIndexesKeys" />            
        </group>

      </tab>
    </tabs>
  </ribbon>
0
 
LVL 42

Expert Comment

by:dlmille
ID: 37836220
Upload your workbook, non-sensitive data, of course.  All I need is your workbook with code and I can help more effectively.

Dave
0
 
LVL 42

Accepted Solution

by:
dlmille earned 500 total points
ID: 37836368
Here's your XML with the menu item you want, and also the backstage with no file open or save options - I included all the backstage with true/false settings, rather than just omitting those we don't want to deal with.

I took out the GetVisible syntax, so we can focus on what your original question was addressing, and that would require me to add a bunch of code, so trying to stay in scope with your request.  Next time, it would be useful for you to provide a template of your workbook with the code you already have to work with and thanks for that!

Also, note, I used the Excel 2010 schema, as your question appeared to be focused on that, though your schema was for 2007.  Also, note, the BackStage view is only for Excel 2010.

<customUI onLoad="RibbonOnLoad" xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="true">
	<tabs>		
		<tab id="MyCustomTab" label="Investec Nav" insertAfterMso="TabHome">		
		
			<group id="customGroup1" label="Tracker">		
				<button id="customButton1" label="Add/Update Fund Benchmark" onAction="plsLoadBenchmark" imageMso="AdpDiagramIndexesKeys" size= "large"/>	
			</group>		
		
		</tab>		
	</tabs>		
</ribbon>
    <backstage>	
        <button idMso="FileSave" visible="false"/>	
        <button idMso="FileSaveAs" visible="false"/>	
        <button idMso="FileOpen" visible="false"/>	
        <button idMso="FileClose" visible="true"/>	
        <button idMso="ApplicationOptionsDialog" visible="true"/>	
        <button idMso="FileExit" visible="true"/>	
        <tab idMso="TabInfo" visible="true"/>	
        <tab idMso="TabRecent" visible="false"/>	
        <tab idMso="TabNew" visible="true"/>	
        <tab idMso="TabPrint" visible="true"/>	
        <tab idMso="TabShare" visible="false"/>	
        <tab idMso="TabHelp" visible="true"/>	
    </backstage>	
</customUI>	

Open in new window


I've attached a same file to demonstrate it works.

Cheers,

Dave
Book1.xlsm
0
 

Author Comment

by:MrDavidThorn
ID: 37837056
Brilliant! - thank you very much
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question