VBA exit full screen
Solved
Anthelm
Posted messages
202
Status
Member
-
Anthelm Posted messages 202 Status Member -
Anthelm Posted messages 202 Status Member -
Hello,
I put some formulas in a file to display Excel in full screen and without the menu bar.
The problem is that when I open another file, it seems that this configuration is retained. Is this normal?
Do I need to add a "normal" display in VBA when closing the file I created, would that be sufficient?
Configuration: Windows / Firefox 64.0
I put some formulas in a file to display Excel in full screen and without the menu bar.
The problem is that when I open another file, it seems that this configuration is retained. Is this normal?
Do I need to add a "normal" display in VBA when closing the file I created, would that be sufficient?
Configuration: Windows / Firefox 64.0
3 answers
-
Hello,
“I put a few formulas in a file to allow Excel to display in full screen and without the menu bar.” That's very surprising!!!
What formulas are you using for that?
--
Best regards
Patrice-
'On file open, go to the "Input" sheet
Private Sub Workbook_Open()
Sheets("Input").Select
Range("C45").Value = 0
Sheets("Input").Select
Range("C45").Select
ActiveWindow.Zoom = 75
ActiveWindow.ScrollColumn = 1
ActiveWindow.ScrollRow = 1
Application.DisplayFullScreen = True
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Worksheet Menu Bar").Enabled = False
ActiveWindow.DisplayWorkbookTabs = False
End Sub -
-
-
Yes, well, that was it.
I added:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayFullScreen = False
Application.CommandBars("Formatting").Visible = True
Application.CommandBars("Standard").Visible = True
Application.CommandBars("Worksheet Menu Bar").Enabled = True
ActiveWindow.DisplayWorkbookTabs = True
End Sub
And I no longer have any issues. -
Good evening,
can you simplify and add error handling for both opening and closing to prevent Excel from crashing
Private Sub Workbook_Open()
On Error Resume Next
Sheets("Saisie").Select
Sheets("Saisie").Range("C45").Value = 0
ActiveWindow.Zoom = 75
ActiveWindow.ScrollColumn = 1
ActiveWindow.ScrollRow = 1
Application.DisplayFullScreen = True 'hides the ribbon
ActiveWindow.DisplayWorkbookTabs = False 'hides the tabs
End Sub
and on closing
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.DisplayFullScreen = False 'restores the Ribbon
ActiveWindow.DisplayWorkbookTabs = True 'shows the tabs
End Sub
See you soon
Mike-31
I am responsible for what I say, not for what you understand...