walk through all properties of an object

V

VilMarci

Dear Community,

This is more a general question than office.
Is there any way to walk through all properties of an object and debug the
values?

I am thinking on smtg like this:

for all property of object.properties
debug.property.value
next property

Thanks,
Marton
 
K

Karl E. Peterson

VilMarci said:
Dear Community,

This is more a general question than office.
Is there any way to walk through all properties of an object and debug the
values?

I am thinking on smtg like this:

for all property of object.properties
debug.property.value
next property

This is, in theory, possible. Few care to "go there" though.

Are you familiar with the Locals window? If you're just browsing, perhaps that'll
do?
 
V

VilMarci

Hi,
I am asking this, because the watcher feature here does not work (too slow -
it is a data provider object).
I need to track my changes and if they affect other properties.
Thanks,
Marton
 
K

Karl E. Peterson

VilMarci said:
Hi,
I am asking this, because the watcher feature here does not work (too slow -
it is a data provider object).
I need to track my changes and if they affect other properties.

It's unclear to me whether you know the names of all the properties you want to
query? If so, the quickest/easiest way possible is to hard-code the checks. If
not, there is a typlib I'm aware of that allows you to inspect COM objects. I'm
blanking on the name at the moment, but I can probably dig it out.
 
A

Alan

Many objects have "properties" collections, so I often use:

For Each prop in myObj.Properties
Debug.Print prop.Name & ": " & prop.Value
Next prop

This will parse through the properties collection of, say an ADO Connection
object, but won't be much help with an Excel object...

A
 
K

Karl E. Peterson

Alan said:
Many objects have "properties" collections, so I often use:

For Each prop in myObj.Properties
Debug.Print prop.Name & ": " & prop.Value
Next prop

This will parse through the properties collection of, say an ADO Connection
object, but won't be much help with an Excel object...

Okay, well, just be aware that you're heading down a very dark alley...

http://www.google.com/search?q=typelib+browser

In particular...

http://msdn.microsoft.com/msdnmag/issues/1200/TypeLib/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top