title: dynamically read and/or overwrite an excel file with python without the overwrite alert appearing
body: <p>For some reason the following code runs fine but the file overwrite alert keeps coming up even though I have set xl.EnableEvents = False, the code won't execute further unless I manually click the overwrite file popup. Does anyone know how to fix this? </p>
  
  <p>The code opens an excel file which contains a string which allows the excel file to connect to the bloomberg api, I used this solution <a href="https://stackoverflow.com/questions/2977835/python-win32com-opening-excel-with-bloomberg-plugin">here</a> to get this to work. As long as the file is open for enough time the data is pulled into the file and then saves and exits. It takes around ~35 seconds to get the data and the pandas table starts displaying the content I'm requesting</p>
  
  <p>The problem is the popups! - I need to see when the string '#N/A Requesting Data...' is no longer in the file and can't see a way to do it without periodically saving the file. A solution that allows me to see the file contents dynamically without having to save would be great.</p>
  
  <p>The solution <a href="https://stackoverflow.com/questions/3373955/python-and-excel-overwriting-an-existing-file-always-prompts-despite-xlsavecon">here</a> didn't work for me to stop the popups, I could probably make a new file each time and then delete them all at the end but this seems a bit clunky. This question extends this problem <a href="https://stackoverflow.com/questions/54573249/get-data-from-bloomberg-api-with-python-via-excel?noredirect=1#comment95947308_54573249">here</a> if anyone wants to see the code and the problem in a more full context.</p>
  
  <pre><code>WB = 'C:/path/to/my/file.xlsx'
  location = "EGLL"
  
  def run_VWA(WB, location):
      """open the excel file, allow enough time to pull the data, then close and save"""
  
      bb = 'C:/blp/API/Office Tools/BloombergUI.xla'
      xl=win32com.client.DispatchEx("Excel.Application")  
      xl.Workbooks.Open(bb)
      xl.AddIns("Bloomberg Excel Tools").Installed = True
  
      wb = xl.Workbooks.Open(Filename=WB) #opens workbook in readonly mode.
  
      xl.Visible = False
      xl.EnableEvents = False
      xl.DisplayAlerts = False
  
      total=0
      colstring='#N/A Requesting Data...'
      while total &lt; 40:
          wb.Save()   
          df = df_from_excel(WB, location)
          if colstring not in df:
              break
          time.sleep(3)
          total+=3
  
  
      wb.Close(SaveChanges=1)
      xl.DisplayAlerts = True
      xl.Quit()
      #Cleanup the com reference. 
      del xl   
  
      return
  </code></pre>
  
  <p>Any help with this is much appreciated, I have very limited experience with the win32com library.</p>