Solved

Excel Backstage - how can I add inbuilt groups to a custom tab

Posted on 2013-11-23
12
885 Views
Last Modified: 2014-02-10
I am developing  a dictator style application in Excel. For that I am completely replacing the backstage. I want to be able to use the standard 'Print' tab (and the preview part of it). I need to however position this tab where I like in backstage. Since there is no way to re-order in-built tabs I have created my own and was going to use the print tab's groups. I can however not get this to work. Whilst the RibbonX passes as valid syntax against the schema it does not show anything in the tab.

I have attached a test file with example RibbonX. To give an idea what I want I have positioned my print tab between two other tabs 'Alpha' and 'Beta'.

If someone could tell me how to do this or achieve the same result then I would be very grateful.
0
Comment
Question by:AL_XResearch
  • 7
  • 4
12 Comments
 
LVL 3

Author Comment

by:AL_XResearch
Comment Utility
0
 
LVL 3

Author Comment

by:AL_XResearch
Comment Utility
Can anyone help ? I really need to add the standard print tab (or some of it's functionality) to my custom backstage ribbon. I have looked all over the internet and no one appears to have tried to do this - I find that hard to believe.
0
 
LVL 3

Author Comment

by:AL_XResearch
Comment Utility
If there any Excel 2010+ developers out there who have created more than a basic custom ribbon then they must have come across this issue - please let me know.
0
 
LVL 24

Expert Comment

by:Bitsqueezer
Comment Utility
Hi,

I did not especially that but worked with Ribbons in general with A2007 and E2007. That's similar to E2010, only few differences.
So first you should open a blank workbook and open Excel options, then go to "Advanced" and scroll down to "General" where you'll find an option "Show add-in user interface errors". During development of ribbons, leave that activated. That will show you any specific error in your XML definition of your ribbon. In your case it shows a bunch of errors which you must repair first.

I also recommend to check your XML first by using different tools like opening with Internet Explorer or with XML editor or XML check of Notepad++ or whatever. They all have different levels of detail information which can tell you where you have an error in the structure. If that is corrected you need to check i.e. if the callback functions are available (if any) and if you have the correct MS IDs in case of internal Office command functions.

You find all you need about ribbons here (search especially for "Backstage"):
http://www.accessribbon.de/en

There is also a ribbon editor you can use to create the XML file.

Cheers,

Christian
0
 
LVL 3

Author Comment

by:AL_XResearch
Comment Utility
Thanks Christian for your detailed response. There are no errors in my XML.

I use the CustomUI editor (Click here) to create my ribbon definition. I have used this for several years and am very confident in it. It validates my XML and so I can be sure my code is valid.

I should mention at this point that the excel system I have created is a very large system (i.e. 79 modules, 200 functions, 160 subs and 29 screens) and has a full custom ribbon consisting of 7 custom tabs (not including Backstage). All the callbacks are available and work. The Print actually works (and shows the preview) - it's just in the wrong place.

My main issue is that it does not appear where I have placed it in the XML. I have several buttons and custom backstage tabs, then the inbuilt print tab and then more custom buttons and then xml to disable the in-built backstage controls. Despite this the print tab goes straight to the top of my custom backstage view.

I know the URL you have indicated very well. It is very helpful (and one of the few sites that gives detailed information and clear examples) but nowhere there or elsewhere on the internet can I see any guidance on how to enable and position an in-built tab amongst your own controls.

Unfortunately I cannot post the actual workbook as it is for a client and is proprietary. I have however included an example workbook of what I am trying to achieve in an earlier post for this question.

Thanks once again, any additional thoughts would be welcome.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 24

Expert Comment

by:Bitsqueezer
Comment Utility
Hi,

when I started your workbook sample with this setting it prompted me for several errors, in detail:

Line 19, Column 60
Failed to find Office control by ID
ID: GroupPrintProtectedView

Line 20, Column 56
Failed to find Office control by ID
ID: GroupPrintSettings

Line 21, Column 55
Failed to find Office control by ID
ID: GroupPrintPreview

Line 5, Column 12
Failed to find Office control by ID
ID: TabPublish

Line 30, Column 47
Unknown Office control ID: TabSave

Line 31, Column 54
Unknown Office control ID: TabOfficeStart

That doesn't look like a valid XML...;-)

Maybe these are IDs you are using in your real workbook and forgot to remove here?
It shows me three tabs after error output: Alpha, MyPrint and Beta, all empty.

So as far as I know from my own ribbons you can create your own tabs (this seems to work here) and then add internal Office functions by using the right OfficeIDs (idMso).

Here G.Avenius shows how to create a custom Office menu:
Backstage View

And here how to find the idMso IDs:
Where can I find the idMSO for a Ribbon Control or imageMso for a symbol in a Ribbon Control?

There should be no problem to add the print tab at the right position using this method.

(It would be helpful to post the XML of your custom UI as I do not have access to the custom UI editor right now.)

Cheers,

Christian
0
 
LVL 3

Author Comment

by:AL_XResearch
Comment Utility
I have put my RibbonX below - although 90% has been removed as it covers 16 pages (!) - it is just for your reference. I am not sure what you really want to look at, my example workbook (whilst it may not work gives the same idea).

customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="rxc_OnLoadRibbon">
	<commands>
		<command idMso="Help" onAction="rxa_showQuickHelp" />
	</commands>
	<ribbon startFromScratch="true">
		<tabs>
			<!-- **************** Standard MS Excel ribbons -->
			<tab idMso="TabHome" getVisible="rxc_XLTabDisplay" />
			<tab idMso="TabInsert" getVisible="rxc_XLTabDisplay" />
			<tab idMso="TabPageLayoutExcel" getVisible="rxc_XLTabDisplay" />
			<tab idMso="TabFormulas" getVisible="rxc_XLTabDisplay" />
			<tab idMso="TabData" getVisible="rxc_XLTabDisplay" />
			<tab idMso="TabReview" getVisible="rxc_XLTabDisplay" />
			<tab idMso="TabView" getVisible="rxc_XLTabDisplay" />
			<tab idMso="TabDeveloper" getVisible="rxc_XLTabDisplay" />

			<!-- **************** Data Entry -->
			<tab id="mct_DataEntry" >
				<!-- Code for this here -->
			</tab>
			<!-- More tabs -->
		</tabs>
		<qat>
			<sharedControls>
			</sharedControls>
		</qat>
	</ribbon>


	<backstage onShow="rxc_refreshBackstage">
		<button id="mcb_bckstg_Login" label="Login"  />
		<button id="mcb_bckstg_Logout" label="Logout" /> 
		<button id="mcb_RequestPasswordReset" label="Request Password Reset" />
		
		<tab id="bcksg_tab1" >
		</tab>
		<tab id="bcksg_tab2" >
		</tab>
		
		<button id="mcb_bckstg_HelpContents" label="Help" />
		<button id="mcb_bckstg_HelpAbout" label="About"/>
		<button id="mcb_bckstg_exitSystem" label="Exit Client"  />
		<!-- Disable the standard backstage controls -->
		<button idMso="FileSave" visible="false"/>
		<button idMso="FileSaveAs" visible="false" />
		<button idMso="FileOpen" visible="false" />
		<button idMso="FileClose" visible="false" />
		<button idMso="ApplicationOptionsDialog" visible="false" />
        	<button idMso="FileExit" visible="false" />
		<tab idMso="TabInfo" visible="false" />
		<tab idMso="TabRecent" visible="false" />
		<tab idMso="TabNew" visible="false" />
		<tab idMso="TabPrint" />
		<tab idMso="TabShare" visible="false" />
		<tab idMso="TabHelp" visible="false" />
		<tab idMso="TabPublish" visible="false" />
		<tab idMso="TabSave" visible="false" />
		<tab idMso="TabOfficeStart" visible="false" />
	</backstage>
</customUI>

Open in new window


I will appreciate any suggestions you can make as this is really got the better of me and I need to correct it asap for my client. Many thanks in advance.
0
 
LVL 24

Accepted Solution

by:
Bitsqueezer earned 500 total points
Comment Utility
Hi,

I only wanted to see the XML in your sample as I was not able to extract that at that point of time.

In the meantime I was able to experiment a while with the backstage ribbon of Excel 2010 and found out that it is indeed not possible to do what you want to do.

Here is a MS page about backstage ribbons:
Introduction to the Office 2010 Backstage View for Developers

On this page there is a FAQ which says:
Can I specify where to add a tab?
    You can specify whether a custom tab is displayed before or after an existing tab.

Can I reorder existing tabs?
    You cannot re-order existing tabs. You may only specify the relative order of tabs by inserting a tab before or after another tab.

Can I modify the column layout of existing tabs?
    You cannot change the column layouts of any existing tab that you did not create.

Where can I add groups?
    You can add a new group to any column of an existing tab. You can also specify whether the new group is displayed before or after an existing group. One restriction is that you cannot add more groups to tabs which contain a taskFormGroup such as the Share tab.

Can I reorder existing groups?
    You cannot reorder existing groups. You can only specify relative orders for new groups that you create.

I understand from that that you can a) not rearrange the order of internal tabs, you can only switch them on or off and b) you can't use the internal groups like you want in other custom tabs.

So you can choose now if you simply set the print tab to visible (which I would prefer, doesn't really make a difference where the tab is positioned, main thing is that it is available and working) or if you completely build an own tab where you insert all the functions you want to have manually - but you will not be able to insert anything of the original tab there as these functions are not available for custom manipulation or inserting in own ribbons (as far as I've understood that).

Here's another helpful link from MS which was removed by MS but available in the Google cache which shows some nice examples how to customize the Ribbon layout in the backstage area - maybe helpful if you want to create a custom print ribbon:

https://webcache.googleusercontent.com/search?q=cache:W26htYLY77EJ:http://msdn.microsoft.com/en-us/library/ee815851%28v%3Doffice.14%29.aspx%2Bexcel+2010+backstage+group+idmso&hl=de&biw=&bih=&gbv=1&ct=clnk

Cheers,

Christian
0
 
LVL 3

Author Comment

by:AL_XResearch
Comment Utility
Thanks very much Christian, I remember reading this page long ago but had missed the "You cannot re-order existing tabs" - probably I skipped over it as it is largely referring to customizing existing tabs / groups.

Thank you for drawing my attention to the MS removed page. I read this some time back and it was a very useful starting point - I don't know why they would remove it.

I have to say I think it is a big miss from MS for not allowing re positioning of in-built backstage tabs. In fact the manipulation and control of all the backstage controls is limited indeed when compared with the main ribbon. I initially hated the ribbon but once you get your head around the 'reverse logic' of being unable to change it from the VBA it is actually a good interface and makes it easy to put a good-looking front on your development.

Many thanks again.
0
 
LVL 24

Expert Comment

by:Bitsqueezer
Comment Utility
Hi,

yes, I agree in your opinion about the Ribbons: They give self-written applications a more professional look and are easy to use, but MS should really make it simpler to customize them (also a better documentation would be good). If there were not pages like accessribbon.de it would be really hard to figure out how to customize them.

Maybe they change the possibility of customizations in future but there is a higher chance that it will be completely replaced sometime in the future by something more strange like Windows 8...

Cheers,

Christian
0
 
LVL 3

Author Closing Comment

by:AL_XResearch
Comment Utility
Cheers for your help Christian.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

763 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

10 Experts available now in Live!

Get 1:1 Help Now