Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Object Browser does what?

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?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Object Browser does what?

Btw, rFound is dimmed as a range.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Object Browser does what?

Range doesn't have an xldown method or property. xldown is a constant used
as an argument to the End Property which the Range object does have.

set rFoundHD = Range("B9")
ActiveSheet.Range(rFoundHd, rFoundHd.End(xlDown)).Select

works for me.

To the best of my knowledge, the Object Browser is largely complete. If one
understands the basics, then it should be a source of help. Obviously, what
works for many may not work for all. If it is a help to you, then use it.
If it is more of a hinderance than a help, then it might not be the right
tool for you.

You are equating activeSheet to worksheet, but the activesheet is not always
a worksheet (It may be a chart as an example) - so it doesn't inherently
have the properties of a worksheet nor is it necessarily the parent of a
range. The parent of a worksheet range is always a worksheet. Sometimes
this parent may be the activesheet.

--
Regards,
Tom Ogilvy

"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?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Object Browser does what?

The error in your line of code is that you are not using the end property
instead you are using the constant associated with the property. End is what
you want to use, so the line will look like this:

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

A am assuming that you rFoundHd is a range object that is declared as a
range. As for the object browser it can be quite useful but it takes a bit of
practice and a bit of knowledge about the object you are using. Just keep
writing code and eventually it will be easy. That is what I keep telling
myself...
--
HTH...

Jim Thomlinson


"davegb" wrote:

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?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Object Browser does what?

Please let's not argue this chestnut again. 35 posts between March 18-23
should be enough.

--
HTH

Bob Phillips

"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?





  #6   Report Post  
Posted to microsoft.public.excel.programming
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?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Object Browser does what?

Thanks for your reply, Tom.
The code works fine now.
I'm clear I don't understand the basics, wish there were a good
reference to learn them. I guess slogging away is the only option, so
I'll continue. Rote memorization has never been my forte, do much
better when there is logic I can learn. And rote memorization is really
hard when there's no complete reference to memorize from!
So I'll just keep relying on the kindness of people here.


Tom Ogilvy wrote:
Range doesn't have an xldown method or property. xldown is a constant used
as an argument to the End Property which the Range object does have.

set rFoundHD = Range("B9")
ActiveSheet.Range(rFoundHd, rFoundHd.End(xlDown)).Select

works for me.

To the best of my knowledge, the Object Browser is largely complete. If one
understands the basics, then it should be a source of help. Obviously, what
works for many may not work for all. If it is a help to you, then use it.
If it is more of a hinderance than a help, then it might not be the right
tool for you.

You are equating activeSheet to worksheet, but the activesheet is not always
a worksheet (It may be a chart as an example) - so it doesn't inherently
have the properties of a worksheet nor is it necessarily the parent of a
range. The parent of a worksheet range is always a worksheet. Sometimes
this parent may be the activesheet.

--
Regards,
Tom Ogilvy

"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?


Reply
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
Object Browser Icons dhstein Excel Discussion (Misc queries) 2 June 19th 09 12:15 AM
VBA and Object Browser Help Missing Lee Setting up and Configuration of Excel 0 March 13th 06 10:02 PM
Object Browser Help [email protected] Excel Programming 0 January 6th 05 08:19 PM
Object Browser Help [email protected] Excel Programming 0 January 6th 05 08:18 PM
VBA Object Browser icons key dannyraw Excel Programming 1 October 14th 04 05:08 PM


All times are GMT +1. The time now is 10:47 PM.

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

About Us

"It's about Microsoft Excel"