Solved

Excel 2010 amend file Tab ribbon

Posted on 2012-04-11
5
1,063 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
  • 3
  • 2
5 Comments
 
LVL 41

Expert Comment

by:dlmille
Comment Utility
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
Comment Utility
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 41

Expert Comment

by:dlmille
Comment Utility
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 41

Accepted Solution

by:
dlmille earned 500 total points
Comment Utility
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
Comment Utility
Brilliant! - thank you very much
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now