COM usage problem?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dursun

    #1

    COM usage problem?

    I have created a COM class library in VS2005 useing VB.Net. Everything seem
    to be OK with the creation. I created a new VB Win project, and wanted to use
    the component (a function, not a control). When I try to include this COM
    library into my project, I get the error that reads

    --------------------
    A Reference to XYZ could not be added.
    The ActiveX type library 'C:\...\XYZ.tbl ' was exported from a .NET assembly
    and cannot be added as a reference.
    Add a reference to the .NET assembly instead.
    --------------------

    ANY HELP COMMENTS...

    ALSO, can I use this COM library from within a VB macro in Excel? I tried...
    I can see and add the reference (no problem), instantiate it, called a
    public function of the class (no problem) but then, when I run the macro it
    is giving me the following error:

    ----------------
    Compile error:
    Function or interface marked as restricted, or the function uses an
    Automation type not supported in Visual Basic
    -----------------

    PLEASE COMMENT!

    Thanks,

    Dursun

  • VJ

    #2
    Re: COM usage problem?

    Why would you create a COM dll in .NET and use it back in .NET ... just out
    of curiosity.. why can't it be a DLL..

    VJ

    "Dursun" <Dursun@discuss ions.microsoft. com> wrote in message
    news:DF99A954-84AF-4944-B654-1B4EB2A1D8F7@mi crosoft.com...[color=blue]
    >I have created a COM class library in VS2005 useing VB.Net. Everything seem
    > to be OK with the creation. I created a new VB Win project, and wanted to
    > use
    > the component (a function, not a control). When I try to include this COM
    > library into my project, I get the error that reads
    >
    > --------------------
    > A Reference to XYZ could not be added.
    > The ActiveX type library 'C:\...\XYZ.tbl ' was exported from a .NET
    > assembly
    > and cannot be added as a reference.
    > Add a reference to the .NET assembly instead.
    > --------------------
    >
    > ANY HELP COMMENTS...
    >
    > ALSO, can I use this COM library from within a VB macro in Excel? I
    > tried...
    > I can see and add the reference (no problem), instantiate it, called a
    > public function of the class (no problem) but then, when I run the macro
    > it
    > is giving me the following error:
    >
    > ----------------
    > Compile error:
    > Function or interface marked as restricted, or the function uses an
    > Automation type not supported in Visual Basic
    > -----------------
    >
    > PLEASE COMMENT!
    >
    > Thanks,
    >
    > Dursun
    >[/color]


    Comment

    • Dursun

      #3
      Re: COM usage problem?

      To have it easily available to other users/programmers who might be using it
      in Office application macros. Also. I wanted it to be listed in the COM tab
      of the reference dialog box.

      Do you have any suggestion?

      Thx,

      D

      "VJ" wrote:
      [color=blue]
      > Why would you create a COM dll in .NET and use it back in .NET ... just out
      > of curiosity.. why can't it be a DLL..
      >
      > VJ
      >
      > "Dursun" <Dursun@discuss ions.microsoft. com> wrote in message
      > news:DF99A954-84AF-4944-B654-1B4EB2A1D8F7@mi crosoft.com...[color=green]
      > >I have created a COM class library in VS2005 useing VB.Net. Everything seem
      > > to be OK with the creation. I created a new VB Win project, and wanted to
      > > use
      > > the component (a function, not a control). When I try to include this COM
      > > library into my project, I get the error that reads
      > >
      > > --------------------
      > > A Reference to XYZ could not be added.
      > > The ActiveX type library 'C:\...\XYZ.tbl ' was exported from a .NET
      > > assembly
      > > and cannot be added as a reference.
      > > Add a reference to the .NET assembly instead.
      > > --------------------
      > >
      > > ANY HELP COMMENTS...
      > >
      > > ALSO, can I use this COM library from within a VB macro in Excel? I
      > > tried...
      > > I can see and add the reference (no problem), instantiate it, called a
      > > public function of the class (no problem) but then, when I run the macro
      > > it
      > > is giving me the following error:
      > >
      > > ----------------
      > > Compile error:
      > > Function or interface marked as restricted, or the function uses an
      > > Automation type not supported in Visual Basic
      > > -----------------
      > >
      > > PLEASE COMMENT!
      > >
      > > Thanks,
      > >
      > > Dursun
      > >[/color]
      >
      >
      >[/color]

      Comment

      Working...