VBA Tip: Force Macros to Run

One way to do this is to hide all the worksheets except for one, then display all the worksheets when the user enables macros ...


To put this system in place, start by creating the 'splash sheet' (the worksheet that the user will see when macros are disabled):

visible sheet - force enabling of macros

Then hide all the worksheets except for the 'splash sheet' (property: Visible):

visible - force enabling of macros

And add the following code to ThisWorkbook:

Private Sub Workbook_Open()

    'Display the worksheet EXAMPLE
    Sheets("EXAMPLE").Visible = -1
   
    'Splash sheet hidden
    Sheets("MACROS").Visible = 2

End Sub

Save, close and then give it a try !

The downloadable Excel file containing this example: example.xls