Hi there,
How can I open an excel file from c# so that the application actually opens on screen?
The below code opens the file but it doesnt open onscreen - what am i missing?
Thanks
JB
string
filePath = (Environment.CurrentDirectory + @"\xlsx\Book2.xlsm");Microsoft.Office.Interop.Excel.
ApplicationClass excelApp = new Microsoft.Office.Interop.Excel.ApplicationClass(); // Microsoft.Office.Interop.Excel.Workbook workBook = excelApp.Workbooks.Open(filePath, 0, // true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, // "\t", false, false, 0, true, 1, 0); Workbook workBook = excelApp.Workbooks.Open(filePath, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
jack burtonPosted Aug 11, 2008, 5:09 PM
Muhammad Shahid FarooqPosted Aug 11, 2008, 4:25 PM
Microsoft.Office.Interop.Excel.Workbook workbook = _excel.Workbooks.Add(Type.Missing);
Microsoft.Office.Interop.Excel.Worksheet ws = (Microsoft.Office.Interop.Excel.Worksheet)_excel.ActiveSheet;
ws.Activate();