yearego021
New Member
- Joined
- Jan 19, 2025
- Messages
- 6
- Office Version
- 365
- Platform
- Windows
I have a workbook that I want to open fullscreen. I'm using Application.FullScreen to accomplish this, but when I go to open a different workbook, it also opens full screen. The formula bar is also hidden. I think I've got the code I need just not set up right? Cancel as Boolean?? I have my close sub set up to undo the fullscreen, formula, and scroll bar changes, but don't think I have it set up right.
VBA Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub
Private Sub Workbook_Open()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
'Set scoll area:
ws.ScrollArea = "$A$1:$Z$35"
Next ws
With Application
.DisplayFullScreen = True
End With
With ActiveWindow
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
End With
End Sub
Private Sub Workbook_Close()
With Application
.DisplayFullScreen = False
.DisplayFormulaBar = True
End With
With ActiveWindow
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayWorkbookTabs = True
End With
End Sub