Question: I'm trying to read data from excel file. My problem is when I finished reading it's always appear an dialog ask for save. How can I turn off it?  

![enter image description here](https://i.stack.imgur.com/upitz.png)  

Here is my code:

```
Missing missing = Missing.Value;
            Excel.Application _app = new Excel.Application();
            Excel.Workbook _workBook = _app.Workbooks.Open(e.Argument.ToString());
            Excel.Worksheet _workSheet = _workBook.ActiveSheet;
            Excel.Range _range = _workSheet.UsedRange;
            BackgroundWorker bw = sender as BackgroundWorker;

            for (int i = 0; i < _range.Rows.Count; i++) {
                if (_workSheet.Cells[i + 2, 1].Value != null && _workSheet.Cells[i + 2, 2].Value != null)
                {
                    inputList.Add(new infoInput(_workSheet.Cells[i + 2, 1].Value, _workSheet.Cells[i + 2, 1].Value));
                }
                bw.ReportProgress(((i + 1) * 100)/_workSheet.UsedRange.Rows.Count);
            }
            _workBook.Close();
            System.Runtime.InteropServices.Marshal.ReleaseComObject(_workBook);
             _app.DisplayAlerts = false;
            _app.Quit();

```

P/S Sorry for my English! Thanks in advance.

Answer: 
have you tried something like this

```
_workBook.Close(SaveChanges:false)

```

or 

```
WB.Close(false, Type.Missing, Type.Missing);

```

according to this link:

<http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.close.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1>

if you omit this parameter, a save dialog will appear.

> 
> If there are no changes to the workbook, this argument is ignored. If
>  there are changes to the workbook and the workbook appears in other
>  open windows, this argument is ignored. If there are changes to the
>  workbook but the workbook does not appear in any other open windows,
>  this argument specifies whether changes should be saved, as shown in
>  the following list.
> 
> 
> true. Saves the changes to the workbook. If there is not yet a file
>  name associated with the workbook, then FileName is used. If FileName
>  is omitted, the user is asked to supply a file name.
> 
> 
> false. Does not save the changes to the workbook.
> 
> 
> Omitted. Displays a dialog box asking the user whether or not to save
>  changes.
> 
> 
>
I had this same problem. All the suggestions about macros, repairing MS Office, etc. were no help at all -- although they were related to the problem ...

It turns out that I accidentally changed a date in one cell of the spreadsheet from a valid date -- ex: 02/06/2021 -- to the letter "H". I don't know when I did it, but it was not a temporary change -- i.e., I apparently hit Enter or an arrow kay after the change. Interestingly, that cell was NOT linked to any macros or formulas; it just was formatted as a date. When I repaired the date, and saved the spreadsheet, the problem went away for good.