Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Problem with opening excel in Vb.net 2005

Problem with opening excel in Vb.net 2005

Scheduled Pinned Locked Moved Visual Basic
helpcsharpcom
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nazimghori
    wrote on last edited by
    #1

    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.Worksheet

    Dim 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))"

    D G 2 Replies Last reply
    0
    • N nazimghori

      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.Worksheet

      Dim 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))"

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      Which line? Have you added correct Excel reference?

      It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

      1 Reply Last reply
      0
      • N nazimghori

        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.Worksheet

        Dim 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))"

        G Offline
        G Offline
        gg4237
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups