Raymond
asked on
Re-use some class modules
I have two different VB6 projects.
I want to re-use one class module from project A, so I opened the project B and selected "Add Class Module" to add the moda.cls file. But when I tried to compile project B, the following error occur:
Set moda = New moda
^ ^
"Compile error: Variable not defined"
Why? How can I fix this error?
Thank You.
raymng
I want to re-use one class module from project A, so I opened the project B and selected "Add Class Module" to add the moda.cls file. But when I tried to compile project B, the following error occur:
Set moda = New moda
^ ^
"Compile error: Variable not defined"
Why? How can I fix this error?
Thank You.
raymng
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Don't use the same name with variable and class
dim objmoda as moda
Set objmoda = New moda
dim objmoda as moda
Set objmoda = New moda
ASKER
I overlooked this.