Link to home
Start Free TrialLog in
Avatar of Raymond
RaymondFlag for Hong Kong

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
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Raymond

ASKER

Oh, thanx!
I overlooked this.
Avatar of GoodJun
GoodJun

Don't use the same name with variable and class

dim objmoda as moda
Set  objmoda  = New moda