Backstage and Dictator Application

hatman

Well-known Member
Joined
Apr 8, 2005
Messages
2,664
I built a dictator application way back in XL 2003. In order to update to XL2007, and still be backwards compatible, I built the Ribbon in a separate xlsm file that gets loaded if the user is running XL2007 or later. Upon load, the workbook.addin property gets set to true so the ribbon is visible in the xlsm file that houses all of the actual code. The ribbon file makes a remote call to the main file with teh following code:

Code:
Sub CallBack_File(control As IRibbonControl)
    Dim Route As String
    
    Select Case control.id
    
        Case "New_File"
            Route = "New_File"
            
        Case "Open_File"
            Route = "Open_File"
        
        Case "Save_File"
            Route = "Save_File"
        
        Case "Save_As_File"
            Route = "Save_File_As"
        
        Case "File_Close"
            Route = "Closeup"
        
        Case "Print"
            Route = "Print_It"
        
        Case "Print_Preview"
            Route = "Print_Preview"
        
        Case "Page_Setup"
            Route = "Print_Setup"
            
        Case "Export_As_Bmp"
            Route = "Export_As_Bitmap"
        
    End Select
    
    Application.Run Chr(39) & Main_App_WB_Name & Chr(39) & "!" & Route
    
End Sub

Building the XL2010 part of the xml code was not a problem, and only slightly more challeging putting these buttons into Backstage instead of the Office Button (where they were in 2007). Where I am annoyed is that when these buttons are pressed in Backstage, the view does NOT automatically toggle back to the worksheet. I am stumped as to what code to use to toggle the view back. I tried *cringe* sendkeys to emulate the Escape key... no dice. Any advice?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
It sounded promising. But it gives the error "Invalid procedure call or argument"

ETCRA_Ribbon_UI.ActivateTabMso "customTab_ETCRA_Home"
 
Upvote 0
Resolved: Backstage and Dictator Application

Further research of the ActivateTabMSO method pointed me to this article, which has a code sample that sets the isDefinitive property of the control to TRUE. This property, apparently, is unique to controls in the Backstage object (?), and according to the article:
The isDefinitive attribute is set to True to close the Backstage view and return to the workbook when you click the ... button.

Problem solved.

Thanx for pointing me in what ended up a fruitful direction.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top