title: VBA DisplayAlert not setting to false
body: <p>I'm having an issue in excel VBA with application.displayalerts = false. </p>
  
  <p>When I send this command line in my program the displayalerts properties don't change to false, it remains true. When I execute it in the immediate window it turns to false. I couldn't find anything related to that.</p>
  
  <p>I've already checked for the EnableEvent properties as I found on another topic, it is enabled.</p>
  
  <p>I'm not sure which part of my code I should post because I tried this command both where I want it, in the middle of my code and as the first line of code. Also, this is running on an excel file which has other modules, some of them have public functions (which shouldnt affect anything) and some have public variables that I pasted below. Other than that, this is a complete independent code that don't really on the other ones</p>
  
  <pre><code>Public pctCompl As Integer
  Public statCol As Collection
  Public session As NotesSession
  Public db As NotesDatabase
  Public lmt As Integer
  </code></pre>
  
  <p>The code I'm using for the display alert</p>
  
  <pre><code>Application.DisplayAlerts = false
  </code></pre>
  
  <p>Let me know what else info you guys need or code</p>
  
  <p>EDIT:
  here's the code. Right after the line is executed the displayalerts propertie is still set to true, so it's not the case of it being set to true in other part of the code, the line is not changing the propertie, which is very strange because it does change it when I execute it on the immediate window</p>
  
  <pre><code>Sub Main()
  
  Dim Mwksh As Worksheet
  Dim Metwksh As Worksheet
  Dim Swksh As Worksheet
  Application.DisplayAlerts = False ''''''Dont work
  'Set the worbooks
  Set Mwksh = ThisWorkbook.Sheets(MASTER_SHT)
  Set Swksh = ThisWorkbook.Sheets(SUPPORT_SHT)
  
  'Open the Metrics workbook
  Set Metwksh = OpenFile
  
  'Find the Master File last column and row
  clLast = LastCol(Mwksh, MASTER_HEADER_ROW)
  rwLast = LastRow(Mwksh)
  
  'Copy the content from the master file to the support sheet so it can be fixed before being copied to the metrics file
  Swksh.UsedRange.ClearContents
  Mwksh.Range(MASTER_FIRST_COL &amp; MASTER_HEADER_ROW &amp; ":" &amp; clLast &amp; rwLast).Offset(1, 0).Copy Destination:=Swksh.Range("A1")
  
  DeleteColumns Swksh
  
  InsertColumns Swksh
  
  ClearDataSheet Metwksh
  
  CopyToData Swksh, Metwksh
  
  Metwksh.Parent.RefreshAll
  
  Metwksh.Parent.Close savechanges:=True
  
  MsgBox "Metrics file updated!"
  
  End Sub
  </code></pre>