Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

OleObjects and someproperties

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kris - 23 Jan 2006 23:00 GMT
Hi.

I inserted object; combo box

   Dim combo As OLEObject

Set combo = ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1",
Link:=False, DisplayAsIcon:=False, Left:=100, Top:=100.Top, Width:=96,
Height:=18)

I can set some of the properties

combo.LinkedCell = "$g$6"

but I also have to set ColumnCount and ColumnWidth properties of
combobox. I can do that manually, but they are not listed as a
properties in VBA

Ho to do that from VBA?

Thanks.
Norman Jones - 23 Jan 2006 23:06 GMT
Hi Kris,

Try:

Dim combo As msforms.ComboBox

---
Regards,
Norman

> Hi.
>
[quoted text clipped - 16 lines]
>
> Thanks.
Kris - 24 Jan 2006 03:02 GMT
Thanks, but it works only if you have object on userform, not on worksheet.
Thanks anyway.

> Hi Kris,
>
[quoted text clipped - 26 lines]
>>
>>Thanks.
Chip Pearson - 23 Jan 2006 23:15 GMT
Use

combo.Object.ColumnCount = 2

Signature

Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

> Hi.
>
[quoted text clipped - 18 lines]
>
> Thanks.
Kris - 24 Jan 2006 02:58 GMT
> Use
>
> combo.Object.ColumnCount = 2

This is it.

So simple solutions are so difficult to find.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.