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: 1
Default Can you instantiate classes without hard-coding class names??


I would like to instantiate classes, which I have written in Excel VBA,
without hard-coding class names..

For example, the following code could set obj to a particular
CodeModule.

Set obj = thisWorkbook.VBProject.VBComponents(indx)

But I really need to instantiate the class that the module represents.
I.e.,

Set obj = new classname
, where classname is thisWorkbook.VBProject.VBComponents(indx).Name.

Any ideas? (If I could accomplish this, it would allow the application
to query all classes in the Class Modules and choose appropriate
classes to process. Hard-coding requires additional redundant code
every time new classes are added.)

Thanks


--
ALittle
------------------------------------------------------------------------
ALittle's Profile: http://www.excelforum.com/member.php...o&userid=28695
View this thread: http://www.excelforum.com/showthread...hreadid=487484

 
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
hard coding a cell darrelly Excel Discussion (Misc queries) 2 October 7th 05 11:24 PM
User-changeable paths into Excel - avoid hard coding gearoi[_3_] Excel Programming 11 August 31st 05 03:10 PM
Hidding Macro names and coding mrbalaje Excel Discussion (Misc queries) 4 April 20th 05 04:23 PM
Instantiate a Class via Automation Mark Excel Programming 0 March 17th 05 03:31 AM
Hard-Coding a File Location ibeetb Excel Programming 1 April 15th 04 06:46 PM


All times are GMT +1. The time now is 05:34 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"