Forum Discussion

keldsor's avatar
keldsor
Brass Contributor
Nov 06, 2022
Solved

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...
  • HansVogelaar's avatar
    HansVogelaar
    Nov 06, 2022

    keldsor 

    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.

Resources