View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy[_7_] Doug Glancy[_7_] is offline
external usenet poster
 
Posts: 55
Default ControlFormat Problem

When I F1 over ControlFormat it seems that it's both a Property and an
Object, which has something to do with why one case works and the other
doesn't, I think.

How about this instead?:

Sub test()
Dim dd As DropDown
Set dd = Worksheets("sheet1").DropDowns("Drop Down 1")
dd.List = Array("a", "b") ' <-- error line
End Sub

hth,

Doug

"equiangular" wrote in message
...
Sub test()
Dim cf As ControlFormat
Set cf = Worksheets("sheet1").Shapes("Drop Down 1").ControlFormat
cf.List = Array("a", "b") ' <-- error line
End Sub


The code works perfectly if i use Worksheets("sheet1").Shapes("Drop Down
1").ControlFormat.List = Array("a", "b").

Why this is so?

Thanks.