title: Excel Automation - how to just say No
body: <p>I'm working on a vb.net console app that opens a number of spreadsheets one by one, reads in a couple cells and closes the file. </p>
  
  <p>Some of the spreadsheets have formulas that Excel recalculates when I open the file, and I'm getting a dialog box asking me if I want to save changes to the spreadsheet when I close it. </p>
  
  <p>Message: "Do you want to save the changes to myfile.xls?  Microsoft Office Excel recalculates formulas when opening files last saved by an earlier version of Excel"</p>
  
  <p>How do I automatically decline that dialog box?</p>
  
  <pre><code>            Dim newCBD As New CBD
              Dim xlApp As Excel.Application
              Dim xlWorkBook As Excel.Workbook
              Dim xlWorkSheet As Excel.Worksheet
  
              xlApp = New Excel.ApplicationClass
              xlWorkBook = xlApp.Workbooks.Open(myFile)
              xlWorkSheet = xlWorkBook.Worksheets(1)
  
              ...do a bunch of junk here
  
              xlWorkBook.Close()
              xlApp.Quit()
  </code></pre>
  
  <p>Thanks!</p>