Hi
I am trying to open an Excel file, refresh the query behind it and then save and close the file in C#.
I have the following but I am getting errors on the
section:
I have added the Microsoft.Offic e.Interop.Excel reference, but still have the issue?
I am trying to open an Excel file, refresh the query behind it and then save and close the file in C#.
I have the following but I am getting errors on the
Code:
Application excel = new Application()
Code:
Application excel = new Application(); Workbook theWorkbook = excelFile.Workbooks._Open(txtLocation.Text, 0, false, 5, System.Reflection.Missing.Value, System.Reflection.Missing.Value, false, System.Reflection.Missing.Value, System.Reflection.Missing.Value, true, false, System.Reflection.Missing.Value, false); Sheets sheets = (Sheets)theWorkbook.Worksheets; theWorkbook.RefreshAll(); theWorkbook.Save(); excel.Quit();
Comment