I turned off all of the elements when opening Excel. It makes it look like an application.
I have a button that opens a User Form. An apparent side-effect of that process is that the scroll bars reappear.
Can I stop that from happening or is that a function of Excel?
I tried the change event, but showing the user form does not trigger that event.
This hides the elements on individual sheets.
Sub HideWorksheetElements()
Dim State As Boolean
' Hide work sheet elements except while developing - reverse status in Production
If Sheets("Lookups").Range("B6").value = "Production" Then
State = False
Else
State = True
End If
With ActiveWindow
.DisplayGridlines = State
.DisplayHorizontalScrollBar = State
.DisplayVerticalScrollBar = State
.DisplayHeadings = State
End With
End Sub
This hides the elements upon workbook opening:
Sub HideAll()
With ActiveWindow
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayHeadings = False
.DisplayWorkbookTabs = False ' Change to False in Prouction
End With
With Application
.DisplayStatusBar = False
.DisplayFormulaBar = False
.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"
End With
End Sub
This calls the userform.
Private Sub UserForm_Initialize()
Me.StartUpPosition = 0
Me.Top = 125
Me.Left = 400
End Sub