Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default 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
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
Colon at the end of excel file name(ex: problem.xls:1, problem.xls financeguy New Users to Excel 2 January 15th 10 01:15 AM
ThisWorkbook.Saved = True does not work when Shapes().ControlFormat.Enabled = False Joe HM Excel Programming 0 August 3rd 06 07:46 PM
Shape ControlFormat.LinkedCell returns wrong Address for named range - BUG [email protected] Excel Programming 10 July 14th 06 03:05 PM
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM


All times are GMT +1. The time now is 06:35 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"