Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObjects and someproperties
Hi.
I inserted object; combo box Dim combo As OLEObject Set combo = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObjects and someproperties
Hi Kris,
Try: Dim combo As msforms.ComboBox --- Regards, Norman "Kris" wrote in message ... Hi. I inserted object; combo box Dim combo As OLEObject Set combo = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObjects and someproperties
Use
combo.Object.ColumnCount = 2 -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Kris" wrote in message ... Hi. I inserted object; combo box Dim combo As OLEObject Set combo = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObjects and someproperties
Chip Pearson wrote:
Use combo.Object.ColumnCount = 2 This is it. So simple solutions are so difficult to find. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
OleObjects and someproperties
Thanks, but it works only if you have object on userform, not on worksheet.
Thanks anyway. Norman Jones wrote: Hi Kris, Try: Dim combo As msforms.ComboBox --- Regards, Norman "Kris" wrote in message ... Hi. I inserted object; combo box Dim combo As OLEObject Set combo = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
OLEObjects | Excel Programming | |||
Problem with OLEObjects | Excel Programming | |||
OLEObjects .. again | Excel Programming | |||
Taking over OLEObjects... Possible ?! | Excel Programming | |||
OLEObjects clickable? | Excel Programming |