|
-
Apr 30th, 2005, 05:30 PM
#1
Thread Starter
New Member
[Rsolved]Inaccessible class module
Here's my problem. I'm using VBA in Excel, running under Windows 2000. I wrote a class module and placed it in a project (workbook) which also contains a bunch of other utilities. I wrote a stub program to call the methods of the class in order to test the output, and saved it alone in a separate module in the same project. I can run the stub subroutine and it calls each of the four methods in turn and retrieves the correct results. However, when I copied the stub module verbatim into another project, I got a compile error saying "User-defined type not defined". I placed a reference to the project containing the class module in the project from which I want to call the class's methods. That didn't help. I used the object browser to look at the class module and found that it required a reference to Microsoft VBA Extension 5.1. I placed a reference to Microsoft VBA Extension 5.1 in the problem project. That didn't help either.
I'm starting to suspect that the problem may be some type of security setting which keeps the class module from being accessible to another project. Keep in mind that the two stub modules are identical. The object is instantiated identically in each, and then all of its methods are called one at a time. The only difference is that one is in the same project as the class module and the other isn't. And the first one works, and the second one doesn't. Anybody have any insight into this?
Last edited by Querent; May 9th, 2005 at 02:04 AM.
Reason: Resolved
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|