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: 14
Default Using a string to set an object reference?

Hi,

This is hard to explain. Let me describe the situation:

Suppose I have a set of custom classes clsAbstract, cls1, cls2, and
cls3, where the last three classes implement clsAbstract, and then a
custom collection that only takes objects of type clsAbstract.

On a worksheet, in the Activate event, I set a global variable that
stores the locations of some "anchor" ranges which form the top left
corner of the areas containing information that cls1, cls2, and cls3
are going to need. The locations are stored as a string so I can use
Split to get the addresses. I know that cls1 will always be anchored
at the first address in the array, cls2 at the second, etc.

Now, what would be nice is if I could pass the "anchor" address to the
collection and let it decide which object it's going to use. I thought
that maybe I could have it looking at a table in another worksheet or
something, where you have, say:

A32 cls1
A56 cls2
A100 cls3

and then it uses the text in column 2 and sets the object reference to
a new object of type (whatever it looked up). Can I do this? I've
searched around a lot, but I can't figure out what to search for, much
less whether this is possible.

 
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
why do I get this [object reference not set to an instance of an. experience4me Excel Discussion (Misc queries) 1 March 29th 07 04:40 PM
How do I add a reference to an object library using VBA? GPDynamics Excel Programming 1 December 11th 04 12:36 AM
web page object reference Thierry[_3_] Excel Programming 1 August 19th 04 08:35 AM
a string object Daniel[_4_] Excel Programming 3 December 31st 03 10:10 PM
Using a string to point to a form object? plumbye Excel Programming 1 September 8th 03 06:49 PM


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