LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Dynamic controls

Hi,

I wonder if someone can point me in the right direction. I need to create a
variable number of combo boxes dynamically in a spread sheet, taking their
contents from sets of other spreadsheets.

Set cb = ActiveWorkbook.Sheets(1).OLEObjects.Add("Forms.com bobox.1",
Left:=c.Left, Top:=c.Top, Height:=c.Height, Width:=c.Width)
(where c is the cell)

That part is fine, the first time the combo boxes are created.

The user selects from another combo box (design time added) to select
another set of spreadsheets to use to populate the dynamic ones.
The problem is when I want to re-create the page, I need to first delete the
current combo boxes before I create the new ones. How do I reference the
existing combo boxes? I can't add a Name reference to the Add method and I
can't seem to define the name after the combo box has been created (cb.name
= "ComboList1") so end up with the default one of combobox1, combobox2 etc.

If I simply loop through the Shapes collection (for each sh in Shapes), then
I don't seem to be able to distinguish between the design-time-added combo
and the dynamic ones even though they have markedly different names.
(cbxCategories vs comboboxn)

TIA
Martin


 
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
Help with copying dynamic column selected based on remote cell value and dynamic formula fill ers Charts and Charting in Excel 0 March 1st 06 01:05 AM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
creating dynamic controls monika Excel Programming 0 April 1st 04 01:56 AM
Dynamic Label for Controls Rob Bovey Excel Programming 0 September 8th 03 06:47 PM


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