#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default CommandBars

Drop the final S from both of the declarations

Dim myBar As CommandBar
Dim myControl As CommandBarControl

You want each of those variables to represent a single object of that type--not
the entire collection of those objects, right?



S Shipley wrote:

MWhen I try to excute this code I get a compile error on Controls saying the
Method or data member not found. How do I declare myControl so this code
will work?

Dim myBar As CommandBars
Dim myControl As CommandBarControls

Set myBar = CommandBars("Custom")
Set myControl = myBar.Controls.Add(Type:=msoControlComboBox, ID:=1)

Thanks,
Sam


--

Dave Peterson
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
How to set off CommandBars hstijnen Excel Programming 1 November 22nd 06 04:54 PM
commandbars in add-in Geoff Excel Programming 0 June 19th 06 09:28 PM
CommandBars vs CommandBars(1).Controls Sean Excel Programming 3 April 3rd 06 01:34 PM
CommandBars garry Excel Programming 3 June 24th 04 03:12 PM


All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"