private bool OpenExcelFile(string sFileName) { /* * xlApp = new Excel.Application(); * xlApp.DisplayAlerts = false; * xlApp.AskToUpdateLinks = false; * xlApp.ScreenUpdating = false; * xlWorkBook = xlApp.Workbooks.Open(sFileName, false, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); * xlWorkBook.CheckCompatibility = false; * xlWorkBook.UpdateLinks = Microsoft.Office.Interop.Excel.XlUpdateLinks.xlUpdateLinksNever; * xlWorkBook.Activate(); */ xlControl = new DevExpress.XtraSpreadsheet.SpreadsheetControl(); xlControl.AllowDrop = false; xlControl.LoadDocument(sFileName); return(true); }
public void Dispose() { xlSheet = null; xlControl = null; }