title: SaveAs always overwrites existing file
body: <p>I am trying to use the Excel 2013 com interface to use the SaveAs function. Everything is working pretty well except that every SaveAs operation will overwrite the existing file.  </p>
  
  <p>Related Questions:</p>
  
  <p><a href="https://stackoverflow.com/questions/3373955/python-and-excel-overwriting-an-existing-file-always-prompts-despite-xlsavecon">Python and Excel: Overwriting an existing file always prompts, despite XlSaveConflictResolution value</a></p>
  
  <p><a href="https://stackoverflow.com/questions/3730428/why-cant-i-save-as-an-excel-file-from-my-python-code">Why can't I “save as” an Excel file from my Python code?</a></p>
  
  <p>This is how I instantiate Excel:</p>
  
  <pre><code>import win32com.client
  excel = win32com.client.gencache.EnsureDispatch('Excel.Application')
  excel.Visible = 1
  wb = excel.Workbooks.Open('D:\\somefileXYZ.xls')
  excel.DisplayAlerts = False
  </code></pre>
  
  <p>The file 'D:\somefile.xls' already exists.</p>
  
  <p>Using the Microsoft <a href="https://msdn.microsoft.com/en-us/library/bb214129.aspx" rel="nofollow noreferrer">reference</a> it should work like this:</p>
  
  <pre><code>wb.SaveAs('D:\\test.xls', win32com.client.constants.xlWorkbookNormal, \
                              None, None, False, False, win32com.client.constants.xlNoChange, \
                              win32com.client.constants.xlOtherSessionChanges)
  </code></pre>
  
  <p>but it just overwrites the existing file.</p>
  
  <p>Using this it should throw an exception, but this also just overwrites the existing file.</p>
  
  <pre><code>wb.SaveAs('D:\\test.xls')
  </code></pre>
  
  <p>If I remove this line <code>excel.DisplayAlerts = False</code> Excel asked me if I want to overwrite the existing file. But I want to do it automatically.</p>
  
  <p>I did the same at another computer with Excel 2007 and everything was working fine.</p>