in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

MEMBER NOT FOUND" error HRESULT : 0x80020003 (DISP_E_MEMBERNOTFOUND)

Last post 12-28-2007 1:46 AM by Pallavi001. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 12-28-2007 1:46 AM

    MEMBER NOT FOUND" error HRESULT : 0x80020003 (DISP_E_MEMBERNOTFOUND)

    Hello friends,

    I am facing this problem("MEMBER NOT FOUND" error HRESULT : 0x80020003
    (DISP_E_MEMBERNOTFOUND) ) in Visual Basic 2005 (i.e. VB .NET) for the fifth statement(ObjWb = AppXls.Workbooks.Add) in the following code. I searched ,but couldn't get relevent solution. I wil give u the entire form class

    'Option Strict On
    Imports Excel

    Public Class Form1

        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        End Sub

        Private Sub btn_write_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_write.Click
            Dim AppXls As Excel.Application
            Dim ObjWb As Excel.Workbook

            AppXls = CreateObject("Excel.Application")
            AppXls.Visible = True
            ObjWb = AppXls.Workbooks.Add()

            ObjWb.Worksheets().Item("Sheet1").Range("A1").value = "1"

            ObjWb.SaveAs("C:\pp\test.xls")
            ObjWb.Close()
            ObjWb = Nothing
            AppXls.Quit()
            AppXls = Nothing
        End Sub
    End Class
     
    If I comment "Option Strict On", it gives "Member not found". (Points to line - ObjWb = AppXls.Workbooks.Add())
    if "Option Strict On" is put into declares, it gives "Option Strict On disallows late binding",
    "Option Strict On disallows implicit conversions from 'Object' to 'Excel.Application'"

    Added ref are - Microsoft Excel 11.0 Object Library,Microsoft Excel 5.0 Object Library,
    Microsoft Office 10.0 Object Library, Microsoft Office 12.0 Object Library.

    If it supports Add(), Item(), Range(), Value members - it automatically pops up,. But in my case, it doesn't.
    It gives only Equals(), GetHashCode(), GetType(), ReferenceEquals(), ToString() methods.

    Not understanding whats going wrong? Any help would be appriciable.
    Thanks :-)
     
Page 1 of 1 (1 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.