Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default How to create controls at runtime

I want to create a list of checkboxes at runtime.

What is the best way to do it ?
I used the following

Dim ctlName As Control
Set ctlName = Controls.Add("Forms.Checkbox.1", True)

It works, but how do i add a name for the checkbox ? There
is no text or caption method that goes along with it.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default How to create controls at runtime

ctlName.Name = "CheckBox1"

--

Vasant

"Andy Chan" wrote in message
...
I want to create a list of checkboxes at runtime.

What is the best way to do it ?
I used the following

Dim ctlName As Control
Set ctlName = Controls.Add("Forms.Checkbox.1", True)

It works, but how do i add a name for the checkbox ? There
is no text or caption method that goes along with it.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default How to create controls at runtime



Hi Vasant,

The name does not appear on the form. Why is this so ?

Regards,
Andy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to create controls at runtime

You need

ctlName.Caption="Andy"

--

HTH

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

"Andy Chan" wrote in message
...


Hi Vasant,

The name does not appear on the form. Why is this so ?

Regards,
Andy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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
runtime error 429 when trying to create Inet object Radu[_2_] Excel Discussion (Misc queries) 0 April 15th 10 02:08 PM
Assigning events to runtime-created controls - is it possible? BizMark Excel Discussion (Misc queries) 1 November 20th 06 09:36 AM
Add Controls With Events at Runtime llowwelll Excel Programming 10 May 24th 04 11:52 AM
creating controls at runtime defj Excel Programming 2 December 2nd 03 07:14 AM
Create controls dynamically Tom Ogilvy Excel Programming 0 November 24th 03 03:37 PM


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