Solved

Excel 2010 amend file Tab ribbon

Posted on 2012-04-11
5
1,085 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
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 41

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 41

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cascading dropdown 9 27
macro for same location path 2 19
File not loading into PowerPivot 4 9
Sum iF  based on a null cell 11 29
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Outlook Free & Paid Tools
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

912 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

24 Experts available now in Live!

Get 1:1 Help Now