Calling a Class from an external AddIn

  • Thread starter Thread starter Woo Mun Foong
  • Start date Start date
W

Woo Mun Foong

I have written some classes using Access XP ,successfully compiled as a MDE.
I would like to take this MDE and share it with my team members in the form
of AddIn. (Reference)
My intention is for my team members to add a reference of MDE to their MDB
and they can start using my classes inside their MDB.
However when they try to do it, the compiler gives error.

For example : (in my team member MDB)
Dim cFileObj as clsFileInfo
(where clsFileInfo is a class created by me inside another MDB)

The compiler complains :- User-defined type not defined

Please help.
 
You can simply make a public function in the mde that returns an instance of
the object. That will work.

You can also change the class object to be exposed. You can do this. It is
not officially supported. This works with a mdb, and you an then convert it
to a mde.

Check out:

http://www.mvps.org/access/modules/mdl0034.htm

You can use the following to export the class module:

saveastext acmodule,"yourclassname","c:\classname.txt"

Now, fire up your text editor to edit the above. change:

Attribute VB_Exposed = True

and save the file


Then, delete your class module, and then:

loadfromtext acmodule,"yourclassname","c:\classname.txt"

Test this on a copy....
 
Back
Top