Auto List Members

D

David_G

Can anyone assist? I have a problem with Auto List Members, in
particular how reliably they appear or not appear. I often use
Sheets("mySheet"). when I enter the "dot" there is no Auto List
produced. How come?
Similarly, I am currently working with commandbars, in particular the
code below:

Set DDown = CommandBars("myToolbar").controls.add
(Type:=msoControlDropdown)
with DDown
.Caption = "myDropDown" ' Caption does appear in Autolist
members
.Style = msoButtonAutomatic 'Style does not appear neither
does the mso constants
end with

Why is this so inconsistent? Or is it something I don't know?
Your help on any or all aspects of this problem would be appreciated

Thanks
David G
 
J

JP

If you declare a Worksheet object and set an object reference to the
sheet, you should get the dropdown after you press "."

For example:

Dim mysht As Excel.Worksheet
Set mysht = Worksheets("Sheet1")
mysht.


HTH,
JP
 
D

David_G

If you declare a Worksheet object and set an object reference to the
sheet, you should get the dropdown after you press "."

For example:

Dim mysht As Excel.Worksheet
Set mysht = Worksheets("Sheet1")
mysht.

HTH,
JP



- Show quoted text -

Thanks JP,
I understand where you are coming from on the Sheets example. Yes I
have declared a variable and then referenced it, Yes it works.
However what my question is aiming at is what is the guiding
principle(s) that this behaviour is following?? In other words is
this behaviour random? or is this a Systematic event?
I am working with coding commandbars at the moment and I'm finding
there is a high rate of this type of behaviour, i.e. Auto List not
showed.
So, is it true that if this behaviour occurs (no Auto List Members),
then the object variable is not declared properly? If this is true
then I can point to more instances where the object variable is
declared and there is still no auto list members.
Hopefully I can get an understanding,
Thanks
David G
 
J

JP

I reread your original post, and it looks like you are using DDown as
an object reference to a dropdown box, for which a button style
(msoButtonAutomatic) is not appropriate.

From a brief check of the MSDN website, the Style property only
applies to objects instantiated as CommandBarButton or
CommandBarComboBox.

What are you declaring the DDown object as?

--JP
 

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