PDA

View Full Version : Why does Object Browser Show Same Items Multiple Times?



YellowLabPro
09-30-2007, 04:39 AM
Looking at Shapes, the OB displays it three times in the search results box, all which look identical to me. Are they identical? If so why does it get listed multiple times. I see this on several objects in my list.

Library is Excel for all three
Class is Worksheet for all three
Member is Shapes for all three

Selecting any of the three yield the same information in the Members of 'Worksheet' in the following window, the properties window and the help file is the same.

Is there a setting I need/can change to avoid seeing multiple items?

thanks

daniel_d_n_r
09-30-2007, 05:09 AM
You must be viewing all libraries.
Try just selecting excel libraries only

cheers

YellowLabPro
09-30-2007, 05:33 AM
Thanks Daniel,
Some ideas here. If I choose Excel as the library to use to search on, then yes there is only one instance of it, but if I choose VBA Project library, there are two instances.
Giving me the three in total. I am working on a better understanding of how the OB works-
Thinking maybe these additional instances of Shapes showing up in the OB is related to references in VBA Projects, I deleted everthing in my code. I did search and no Shapes are present in my code, yet there are still two showing up in the VBA Project library.

daniel_d_n_r
09-30-2007, 05:43 AM
Mine (VBA Project library) appears to be calling a worksheet a shape.

I have eight shapes and hence eight worksheets.

if you delete a worksheet you will have one less shape.

I have no idea why this is.


Actually it is a member of the Excel worksheet class so I guess it is available whenever you have a worksheet.

In VBE go to help and type in shapes then see the shapes collection object.
And the shapes item method, it kind of explains how worksheet and shapes are together.
I would just confuse you if I tried to explain myself as I dont refer to shapes much.

cheers

Norie
09-30-2007, 07:48 AM
Doug

Why do you want to know how the object browser works?

By the way I get 6 results for Shapes in the results pane.

But there's only one instance of Shapes highlighted in the class pane.:)

YellowLabPro
09-30-2007, 07:58 AM
Norie,
Why do you ask this question?


Why do you want to know how the object browser works?

Norie
09-30-2007, 08:00 AM
Doug

Because I'm wondering why you want/need to know how the object browser works.:)

YellowLabPro
09-30-2007, 08:32 AM
It seems an obvious answer... but maybe it is only obvious to me.
To use the OB effectively and fully in locating and obtaining help information.
Norie do you understand the way the OB works? If so, which I am assuming you do, how is this beneficial to you?
If not, which I doubt, do you not wonder about this, what information is stored away that help solve, explain and assist in programming in VBA?

TonyJollans
09-30-2007, 08:34 AM
"VBA Project" is the name of the project in one of your workbooks. It contains, it seems, two worksheets. Each of those Worksheets has a Shapes collection - from what you say, they are empty but they still exist.

Norie
09-30-2007, 08:45 AM
Doug

No I don't know how the object browser works.:)

And I've never wondered how it works either.

I just use it when I think it will help.

And that's normally just to clarify the syntax of how to use a method/property/whatever.

YellowLabPro
09-30-2007, 10:26 AM
Tony,
That lines up w/ Daniel's explanation.
So what I am deducing from this is, that the OB shows every object, if it is an Excel object it is available in the OB list always, if the object belongs to a workbook/sheet it is available or visible in the OB during its instance.

Thanks Tony, Daniel

YellowLabPro
09-30-2007, 11:39 AM
Norie,
Here is helpful reference. This explains why I am working on understanding the object browser more than just a quick reference, but rather a great resource of catalogued data that will help me along the way.

http://msdn2.microsoft.com/en-us/library/aa168488(office.11).aspx

Figure 1. Object Browser as it opens by default
By default, the Object Browser opens with the contents of all the different object models available. We're only interested in Publisher objects, so let's filter out the objects from the other object models. In the top pane, from the pull-down menu, select Publisher.

Bob Phillips
09-30-2007, 12:01 PM
The OB shows all objects/properties/methods etc in that particular object model, or more accurately those exposed by that object model, not just the ones used in a project.

YellowLabPro
09-30-2007, 12:28 PM
Thanks for the follow up Bob- Taking time to work through it has helped clear this up some.