private void ReadExcel() { Excel.Application xlApp = new Excel.Application(); Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(openFileDialog1.FileName); Excel._Worksheet xlWorksheet = xlWorkbook.Sheets[1]; Excel.Range xlRange = xlWorksheet.UsedRange; . . . . xlWorkbook.Close(0); xlApp.Quit(); }
Close
SaveChanges
Filename
RouteWorkbook
true
false
MSDN wrote: 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.
xlWorkbook.Close(false, Missing.Value, Missing.Value);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)