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:
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?
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?