Problem with opening excel in Vb.net 2005
-
Hello everyone I want to open excel in vb.net for that i write code like.
Dim xl As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.WorksheetDim misValue As Object = System.Reflection.Missing.Value
xl = New Microsoft.Office.Interop.Excel.ApplicationClass
xlWorkBook = xl.Workbooks.Add(misValue)xlWorkBook = xl.Workbooks.Add(misValue)
xlWorkSheet = xlWorkBook.Sheets("sheet1")but it show an error as "Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))"
-
Hello everyone I want to open excel in vb.net for that i write code like.
Dim xl As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.WorksheetDim misValue As Object = System.Reflection.Missing.Value
xl = New Microsoft.Office.Interop.Excel.ApplicationClass
xlWorkBook = xl.Workbooks.Add(misValue)xlWorkBook = xl.Workbooks.Add(misValue)
xlWorkSheet = xlWorkBook.Sheets("sheet1")but it show an error as "Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))"
-
Hello everyone I want to open excel in vb.net for that i write code like.
Dim xl As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.WorksheetDim misValue As Object = System.Reflection.Missing.Value
xl = New Microsoft.Office.Interop.Excel.ApplicationClass
xlWorkBook = xl.Workbooks.Add(misValue)xlWorkBook = xl.Workbooks.Add(misValue)
xlWorkSheet = xlWorkBook.Sheets("sheet1")but it show an error as "Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))"
Here is an excellent link with tips for Excel Automation from .NET. But my suggestion is not to use Excel Automation. For detailed explanation check Excel Interop issues. Try to find some 3rd party library that best suites your needs. I use GemBox.Spreadsheet library for reading and writing Excel files for some time now and it is great. It is very fast and easy to use.