Home All Groups Group Topic Archive Search About
Author
19 Apr 2006 6:24 PM
Dursun
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

Author
19 Apr 2006 7:34 PM
VJ
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

Show quoteHide quote
"Dursun" <Dur***@discussions.microsoft.com> wrote in message
news:DF99A954-84AF-4944-B654-1B4EB2A1D8F7@microsoft.com...
>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
>
Author
19 Apr 2006 7:54 PM
Dursun
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

Show quoteHide quote
"VJ" wrote:

> 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" <Dur***@discussions.microsoft.com> wrote in message
> news:DF99A954-84AF-4944-B654-1B4EB2A1D8F7@microsoft.com...
> >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
> >
>
>
>