Using a .Net class lbrary in Access 2000

  • Thread starter Thread starter RichGolebiowski
  • Start date Start date
R

RichGolebiowski

I have a class library (clsTestLib) that was created in VB.Net that I
would like to use in Access 2000. I created a typelib for the class
using regasm.exe. I am able to refernce (add a reference) the dll
using the generated typelib. In Access, when I run the Access
application and declare a new instance of the class as follows

Dim MyTest As clsTestLib.Class1
Set MyTest = New clsTestLib.Class1

I get an error Run-time message that says "File or assembly name
clsTestLib, or one of its dependencies, was not found".

If I do the same thing in a VB6 project I get the same error message
when I run the project in the IDE. However, if I compile the project
and run the executable file the program works fine, I do not get the
error message and I am able to access the class just fine.

What do I need to do to be able to acess my class library in Microsoft
Access 2000?
 
Hi,

I had this problem myself and have just figured it out...

If your class isn't registered in the GAC your Microsoft Access 2000 program
directory should contain all output, ie .dlls etc generated from your .Net
project.

This directory is usually "C:\Program Files\Microsoft Office\Office10".

The reason for this, as I understand it anyhow, is that MSAccess.exe is the
host application, ie the applications domain and as with .Net if the
required assemblies aren't available in the GAC then the host application
directory must contain them, as private assemblies.

I've done this and my Access 2000 application successfully calls my .Net
assemblies exposed to Com.

Regards,

Simon Rear
 
Back
Top