Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ControlFormat Problem
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ControlFormat Problem
It seems that ControlFormat is a special case.
Thanks a lot. Doug Glancy wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Colon at the end of excel file name(ex: problem.xls:1, problem.xls | New Users to Excel | |||
ThisWorkbook.Saved = True does not work when Shapes().ControlFormat.Enabled = False | Excel Programming | |||
Shape ControlFormat.LinkedCell returns wrong Address for named range - BUG | Excel Programming | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? | Excel Programming |