Serving the Quantitative Finance Community

 
User avatar
amkey04
Topic Author
Posts: 0
Joined: January 5th, 2004, 9:19 am

Class Module in Excel VBA

August 30th, 2004, 3:57 am

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
 
User avatar
afoster
Posts: 5
Joined: July 14th, 2002, 3:00 am

Class Module in Excel VBA

August 30th, 2004, 6:26 am

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.
 
User avatar
amkey04
Topic Author
Posts: 0
Joined: January 5th, 2004, 9:19 am

Class Module in Excel VBA

August 31st, 2004, 1:35 am

ah... i see now. thanks for the help afoster amkey04