Hi Guys
I am writing a fairly complex app in Excel. Part of this is to have what I have called "Calc Plans" which are a series of steps to achive a users required calculations. Basically I have a loop which consumes a list of instructions. Now I've got 99% working - I can
Calc ranges/sheets
Call methods on requsted sheets
call public subs
However the last piece of the puzzle is to call methods on class instances. Now I can indirect the method name via CallByName if I use the actual variable name which is the instance of the class, but I cant figure out how to indirect my reference to my class - and I REALLY dont want to build a big case statement to this.
SO what I want to achive is something like
[VBA]
dim oClassInstance
set oClassInstance = getVariableByName("glb_oRiskCache")
CallByName oClassInstance, "MyMethod".....
[/VBA]
"glb_oRiskCache" is a global variable that holds an instance of one of my classes - all my classes have a similar interface (BTW anyone got a good link to using interfaces in VBA?)
What I need is the "GetVariableByName" function.
Any thoughts/ideas very greatfully received