Saturday 26 March 2016

Show Excel 2007 Ribbon in XLS file using Excel VBA

I have a excel dashboard which works such that before the excel file is closed, I would like to display all the EXCEL ribbon, so that next time excel is opened, the application / excel will show the ribbon. At present, it does not show the ribbon if excel is opened.





Private Sub Workbook_BeforeClose(cancel As Boolean)

On Error Resume Next


Application.ScreenUpdating = True
ActiveWindow.DisplayWorkbookTabs = True
Application.DisplayFormulaBar = True
Application.DisplayFullScreen = False
Application.DisplayStatusBar = True
Application.DisplayScrollBars = True
Application.ScreenUpdating = True
Sheets("Introduction").Select

End Sub



This is an .xls file with Macro and supposed to work in Excel 2003 and Excel 2007.



Also, if "Cancel" is clicked, I do not want to show any of the above / ribbon, as user is supposed to get a protected view of the excel dashboard.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...