bradyboyy88
Well-known Member
- Joined
- Feb 25, 2015
- Messages
- 562
My code below strips away a lot of the excel features that make it excel. The thing is i developed this as a class and only to make the changes to the initial window/ sheet. So I wanted these effects to apply to every sheet so I added a for loop and declared an intitial window variable to make sure i go back to the initial window after applying all effects. However it keeps drawing a object variable or with block variable not set.
Any ideas?
Any ideas?
Code:
Public Sub GuiUpgrade()
Dim Sheet As Worksheet
Dim InitialWindow As Window
'Excel UI Removal
Application.ScreenUpdating = False
With ThisWorkbook.Application
.Cursor = xlNorthwestArrow
.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
.DisplayFormulaBar = False
.DisplayStatusBar = False
End With
InitialWindow = ThisWorkbook.Application.ActiveWindow
For Each Sheet In ThisWorkbook.Sheets
Sheet.Activate
With ThisWorkbook.Application.ActiveWindow
.DisplayWorkbookTabs = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = True
.DisplayGridlines = False
.DisplayHeadings = False
End With
Next Sheet
InitialWindow.Activate
Application.ScreenUpdating = True
'Update Caption on Window Frame
With ThisWorkbook.Application
.ActiveWindow.Caption = ""
.Application.Caption = "Application Name"
End With
End Sub
Last edited: