Forum Discussion
keldsor
Nov 06, 2022Brass Contributor
Dustion: How to turn OFF/ON Ribbon, formular bar etc ect ??
I have a WorkBook where I want the users to have as mush space on the screen as possible - they shall manipulate different kinds of shapes. When finished working that WorkBook I want to set Excel ba...
- Nov 06, 2022
Aargh - I should have seen that. It should be
Private Sub Workbook_BeforeClose(Cancel As Boolean) ActiveWindow.DisplayGridlines = True ...The event is BeforeClose, not Close, and DisplayGridlines is a window property, not an application property.
The Show Gridlines and Show Headings settings are stored in the workbook. Since you change them in the code, Excel sees the workbook as changed, even if you haven't modified any cells.
HansVogelaar
Nov 06, 2022MVP
The DoCmd lines are Access VBA, not Excel VBA. Try this:
Private Sub Workbook_Close(Cancel As Boolean)
Application.DisplayGridlines = True
Application.DisplayFormulaBar = True
ActiveWindow.DisplayHeadings = True
Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",True)"
End Sub
Private Sub Workbook_Open()
markerObjecter
ActiveWindow.DisplayGridlines = False
Application.DisplayFormulaBar = False
ActiveWindow.DisplayHeadings = False
Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",FALSE)"
nextPNR = ThisWorkbook.Sheets("NR-Ark").Range("A1")
rejectOpenWord = ThisWorkbook.Sheets("NR-Ark").Range("A5")
End Sub