title: How to bypass "Macros have been disabled" message and have macros run Workbook_Activate?
body: <p>I have some VBA code that formats/resizes the screen when the workbook/worksheet is activated. </p>
  
  <p>The code is as follows:</p>
  
  <pre><code>Private Sub Workbook_Activate()
    Dim SaveSelection As Object
    Set SaveSelection = Selection
    Application.ScreenUpdating = False
    Range("A1:T50").Select
    ActiveWindow.Zoom = True
    Application.DisplayFullScreen = False
    Application.DisplayFormulaBar = False
    ActiveWindow.DisplayWorkbookTabs = True
    ActiveWindow.DisplayHeadings = False
    ActiveWindow.DisplayGridlines = False
     Range("A1:T50").Select
    ActiveWindow.Zoom = True
    On Error GoTo ExitPoint
    SaveSelection.Select
    Application.ScreenUpdating = True
  ExitPoint:
  End Sub
  </code></pre>
  
  <p>The problem here is that when the user first opens the workbook, they get this Security Warning message "Macros have been disabled", so the macro does not run when the user first opens the workbook because the message appears.</p>
  
  <p>Does anyone know of a workaround to this?</p>