Bruno Lopes
Bruno Lopes

Reputation: 169

Keeping Excel always in full screen mode

I use the following code to make excel look like an "application" or web page when it starts, to make it full screen:

With ActiveWindow
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayHeadings = False
End With

Application.CommandBars.ActiveMenuBar.Enabled = False
Application.DisplayFullScreen = True
Application.CommandBars("Full Screen").Enabled = False

There is a way to prevent excel to return to "normal" mode? Since pressing the "esc" key does it.

Upvotes: 0

Views: 4400

Answers (2)

BRIAN MILANDILE
BRIAN MILANDILE

Reputation: 1

Disable the Esc key.

Private Sub Workbook_Open()
   Application.OnKey "{ESC}", ""
End Sub

Return the Esc key to normal.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
   Application.OnKey "{ESC}"
End Sub

When you minimize the window the icons reappear. you need to also disable minimize of the window.

Upvotes: 0

El Scripto
El Scripto

Reputation: 576

Does this help :

' Disable the Esc key.
Private Sub Workbook_Open()
   Application.OnKey "{ESC}", ""
End Sub

' Return the Esc key to normal.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
   Application.OnKey "{ESC}"
End Sub

Put the above in the "ThisWorkbook" section in the VBA editor.

Upvotes: 1

Related Questions