Error in the C# code
hi
I wrote this code to open excel sheet using C#.net but ther is an error in the open function can you tell me what is it
// Excel object references.
private Excel.Application m_objExcel = null;
private Excel.Workbooks m_objBooks = null;
private Excel._Workbook m_objBook = null;
private Excel.Sheets m_objSheets = null;
private Excel._Worksheet m_objSheet = null;
private object m_objOpt = System.Reflection.Missing.Value;
//object definetion
m_objExcel = new Excel.Application();
m_objBooks = (Excel.Workbooks)m_objExcel.Workbooks;
m_objBook = (Excel._Workbook)(m_objBooks.Add(m_objOpt));
m_objExcel.Visible = true;
m_objBook.OpenLinks("c:/test2.xls",m_objOpt,m_objOpt);
thanks
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

bilnaadRank #2,169 · 655 reputationPosted Dec 6, 2004, 7:33 AM EST
bilnaadRank #2,169 · 655 reputationPosted Dec 6, 2004, 7:34 AM EST