M
marecq
I have a workbook where I want to hide all menu bars and toolbars for
the user when it’s opened. On the other hand, when the workbook is
closed (with a ‘close’ button on the sheet) I’d like to turn everything
back on.
The code is doing fine on the workbook_open event. Everything is
hidden, as I want. However, on the closebutton_click event everything
works fine except for the following 3 lines:
Application.displaystatusbar = true
Application.displayscrollbars = true
Application.displayformulabar = true
For all 3 I get the similar message:
Run-time error 1004 method ‘displayscrollbars’ of object ‘_application’
failed
However, when I write those lines in a separate sub and run it
manually, they work fine. If I try to call this sub when closing the
workbook the error appears again.
Does anyone know what’s happening?
the user when it’s opened. On the other hand, when the workbook is
closed (with a ‘close’ button on the sheet) I’d like to turn everything
back on.
The code is doing fine on the workbook_open event. Everything is
hidden, as I want. However, on the closebutton_click event everything
works fine except for the following 3 lines:
Application.displaystatusbar = true
Application.displayscrollbars = true
Application.displayformulabar = true
For all 3 I get the similar message:
Run-time error 1004 method ‘displayscrollbars’ of object ‘_application’
failed
However, when I write those lines in a separate sub and run it
manually, they work fine. If I try to call this sub when closing the
workbook the error appears again.
Does anyone know what’s happening?