title: Close an instance of excel from within a .net visual basic application Excel asks to save file
body: <p>I have a .net visual basic application which opens a .xls file by starting up an instance of excel.  I process the data in the file and then close the worksheet prior to exiting my application.  All code in the application works fine, the application does what it is supposed to do.  The only issue is that when I close the instance of the worksheet, Excel asks if I want to save the file by displaying the Save File dialog box.  This is the code that I am executing:</p>
  
  <pre><code>        Dim xlApp As Excel.Application
          Dim xlWorkBook As Excel.Workbook
          Dim xlWorkSheet As Excel.Worksheet
          Dim xlsFileName as string = "path to my .xls file"
  
          xlApp = New Excel.Application
          xlWorkBook = xlApp.Workbooks.Open(xlsFileName)
          xlWorkSheet = xlWorkBook.ActiveSheet
  
          Dim range As Excel.Range
          range = xlWorkSheet.UsedRange
          numberOfDataRecords = range.Rows.Count
          numberOfColumns = range.Columns.Count
  
  
          this is where I process the worksheet data
  
  
          xlWorkBook.Close(SaveChanges:=False)
          xlApp.Quit()
  </code></pre>
  
  <p>Am I not closing the workbook correctly? </p>
  
  <p>Thanks!</p>