Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default OleObjects and someproperties

Chip Pearson wrote:
Use

combo.Object.ColumnCount = 2



This is it.

So simple solutions are so difficult to find.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default 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
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
OLEObjects Roy[_8_] Excel Programming 1 May 6th 05 03:51 AM
Problem with OLEObjects augustus Excel Programming 0 April 1st 05 01:23 AM
OLEObjects .. again Roy[_8_] Excel Programming 3 December 17th 04 09:44 AM
Taking over OLEObjects... Possible ?! Alex T Excel Programming 4 June 16th 04 11:02 AM
OLEObjects clickable? Erich Neuwirth Excel Programming 1 June 8th 04 04:27 AM


All times are GMT +1. The time now is 11:04 AM.

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"