View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
George Nicholson[_2_] George Nicholson[_2_] is offline
external usenet poster
 
Posts: 170
Default Object Browser does what?

ActiveSheet could refer to a Worksheet, a Chart sheet, an old-style Macro
sheet or an old-style Dialog sheet. Excel can't resolve the reference until
the code is run (which, BTW, is why Auto-list doesn't provide any drop-down
"help" when you type "Activesheet.").

Q: What would you expect the Object browser to display for the
properties/methods of ActiveSheet that wouldn't be misleading?
A: just what it does list: nothing. Because it could be any one of four
very different object classes, there is no good (much less right) answer.

If you want to view the members of the Worksheet class, look up the
Worksheet class in the ObjectBrowser, not ActiveSheet.

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"davegb" wrote in message
oups.com...
I've been told by others that the Object Browser is a useful tool for
figuring out if a given object/method/property exists under another
object/method/property. I haven't found this to be true. For example,
I'm getting an "Object does not support this property or method" error
on this line of code:

ActiveSheet.Range(rFoundHd, rFoundHd.xlDown).Select

I found the "ActiveSheet.Range" in this forum in many examples. When I
got the error, I looked up Range in VBA help, but it doesn't list
"ActiveSheet" as a parent to ".Range". (Of course, there's no way to
look up "ActiveSheet" and see it's children). So it appears that only
some relationships are shown. Is the OB a partial list? If so, it there
a pattern of some kind to tell what's listed and what's not, or is it
just that some objects/methods/properties were missed?

I've also been very confused when the Object Browser lists multiple
examples of the same parent/child relationship, like Range and
Worksheet. Why tell me twice that range is a child of Worksheet? Is it
because, according to Walkenbach, Worksheet can be an object, a
property or a method? I don't know whether to laugh or cry!

There seems to be lots of help for experts in using VBA, and none for
beginners. Walkenbach's book certainly falls into this category. I've
discussed this in an earlier post and accepted this now. But after
several months of working with VBA, I still don't see much use to the
OB if it's not a complete listing. For right now, I feel that if I want
to know if .Range is a child of ActiveSheet, I have to check the OB,
and if I don't find the relationship, I have to check in this NG to
make sure. Pretty tedious! Is this in fact the way to proceed?

In any case, I do appreciate the help I've gotten here. Without it, I'd
certainly be nowwhere with writing all the code I've written!

And btw, any ideas on why I'm getting the error message on that line of
code?