Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to add items to combobox

people i cant add items to the combobox,

i have sheet.name = s1
and on the sheet i have control placed combobox,
combobox name is combo1


in vb editor i write this text

worksheets("s1").shapes.item("combo1").additem "test"

but vb gives me error like = cant find object ???


how to correctly work with sheet controls from vb ?


thank

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default how to add items to combobox

activesheet.oleobjects("combo1").object.additem "test"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Marek " wrote in message
...
people i cant add items to the combobox,

i have sheet.name = s1
and on the sheet i have control placed combobox,
combobox name is combo1


in vb editor i write this text

worksheets("s1").shapes.item("combo1").additem "test"

but vb gives me error like = cant find object ???


how to correctly work with sheet controls from vb ?


thanks


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to add items to combobox

here is my code

Sub Button2_Click()
ActiveSheet.OLEObjects("combo1").Object.AddItem "test"
End Sub

clicking button i get error

unable to get Oleobjects property of the worksheet


:

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default how to add items to combobox

Marek,

I guess that you must have a forms combobox?

AFAIK there is no way to additem to a forms combo, you have to link to a
spreadsheet range, or change to a control toolbox combo.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Marek " wrote in message
...
here is my code

Sub Button2_Click()
ActiveSheet.OLEObjects("combo1").Object.AddItem "test"
End Sub

clicking button i get error

unable to get Oleobjects property of the worksheet


:(


---
Message posted from http://www.ExcelForum.com/



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
Sorting Items in a ComboBox? NooK[_3_] Excel Programming 2 June 18th 04 07:25 AM
add a range of items to a combobox spence[_3_] Excel Programming 2 January 14th 04 05:59 AM
ComboBox Items Todd Huttenstine[_2_] Excel Programming 1 December 14th 03 11:12 PM
ComboBox Default items Not Showing Shauna Koppang Excel Programming 2 August 21st 03 03:35 AM
ComboBox items Keith Willshaw Excel Programming 2 July 17th 03 11:22 AM


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