LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default OO programming in VBA - VBA equivalent to the "eval" function

Hi Everyone,

This problem has been bugging me for the past couple of days. I have
looked for a solution on the web for hours, but wasn't able to get a
satisfactory answer.

Basically, I have a series of modules that have the same structure,
and I'd like to be able to switch from one to another by changing a
cell of my spreasheet. Ideally, my program would look like this :

Public Function MyMainFunction()

Dim moduleName As String

moduleName = Range("A1").Value ' - I select which module to use
from cell A1

result = moduleName.Function1() ' - This doesn't work, since
moduleName is a String

End Function

Unfortunately, it looks like there is no way in VBA to execute a line
such as:

result = Eval( moduleName & ".Function1()")

Or something similar.

Any thought on how I could do this ?

Thanks a lot for your help !!

Jerome




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the "Eval" function located? Maury Markowitz[_2_] Excel Programming 3 August 28th 08 02:36 PM
Excel equivalent to Eval function PatrickS Excel Programming 1 August 15th 07 11:54 AM
Is there an Excel 2003 equivalent to Word's "versions" function? Steve Excel Discussion (Misc queries) 0 March 4th 07 02:01 AM
"MAXIF" Equivalent function in Excel Vital Miranda Excel Worksheet Functions 5 September 27th 06 11:56 PM
Mround function equivalent that does not require "add-in" Roundy Excel Discussion (Misc queries) 4 April 17th 06 04:00 PM


All times are GMT +1. The time now is 09:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"