Page 1 of 1

Class Module in Excel VBA

Posted: August 30th, 2004, 3:57 am
by amkey04
Hi,Can I call a Class Module without declaring it as Dim ABC as New XYZ? My Code looks something like this ,Function testing (i as integer,j as integer) MathOperation.sum (i,j)end functionclass module MathOperation: Function sum(x as integer, y as integer) sum = x + y end functionThanks a lot for any help in advance Amkey04

Class Module in Excel VBA

Posted: August 30th, 2004, 6:26 am
by afoster
In VBA this is not possible, as the Instancing property of a Class module can only be set to either Private or PublicNotCreatable.In VB 6, you can do this by setting the Instancing property to GlobalMultiUse.

Class Module in Excel VBA

Posted: August 31st, 2004, 1:35 am
by amkey04
ah... i see now. thanks for the help afoster amkey04