Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Creating Userform Controls on Frame

Hi all,

How can I create "on the fly" other controls on a Frame, if the frame itself
is to be created on the fly. The following code (simplified to create a
CheckBox on a Frame) failed.

Private Sub Userform_Initialize()
Dim x as Control, y as Control
Set x = Me.Controls.Add("Forms.Frame1.1")
Set y = Me..Frame1.Controls.Add("Forms.CheckBox1.1")
End Sub

The code balks at "Frame1" with "Method or data member not found" error
message. Apparently, the code fails to detect the Frame purported to have
been created earlier.

Any help will be appreciated.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Creating Userform Controls on Frame

The code you purport to partially work appears to have errors. Anyway, this
worked for me:

Private Sub Userform_Initialize()
Dim x As Control, y As Control
Set x = Me.Controls.Add("Forms.Frame.1", Name:="Frame1")
Set y = x.Controls.Add("Forms.CheckBox.1", Name:="Chkbx1")
End Sub

--
Regards,
Tom Ogilvy


"David Myle" wrote in message
...
Hi all,

How can I create "on the fly" other controls on a Frame, if the frame

itself
is to be created on the fly. The following code (simplified to create a
CheckBox on a Frame) failed.

Private Sub Userform_Initialize()
Dim x as Control, y as Control
Set x = Me.Controls.Add("Forms.Frame1.1")
Set y = Me..Frame1.Controls.Add("Forms.CheckBox1.1")
End Sub

The code balks at "Frame1" with "Method or data member not found" error
message. Apparently, the code fails to detect the Frame purported to have
been created earlier.

Any help will be appreciated.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Creating Userform Controls on Frame

Many thanks Tom.

DM


"Tom Ogilvy" wrote in message
...
The code you purport to partially work appears to have errors. Anyway,

this
worked for me:

Private Sub Userform_Initialize()
Dim x As Control, y As Control
Set x = Me.Controls.Add("Forms.Frame.1", Name:="Frame1")
Set y = x.Controls.Add("Forms.CheckBox.1", Name:="Chkbx1")
End Sub

--
Regards,
Tom Ogilvy


"David Myle" wrote in message
...
Hi all,

How can I create "on the fly" other controls on a Frame, if the frame

itself
is to be created on the fly. The following code (simplified to create a
CheckBox on a Frame) failed.

Private Sub Userform_Initialize()
Dim x as Control, y as Control
Set x = Me.Controls.Add("Forms.Frame1.1")
Set y = Me..Frame1.Controls.Add("Forms.CheckBox1.1")
End Sub

The code balks at "Frame1" with "Method or data member not found" error
message. Apparently, the code fails to detect the Frame purported to

have
been created earlier.

Any help will be appreciated.






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
Creating a Frame in Excel 2003 nicfd Excel Discussion (Misc queries) 1 October 7th 08 11:14 AM
Sow do i make a userform know if a value is true in a frame, then CSUS_CE_Student[_2_] Excel Discussion (Misc queries) 1 May 13th 07 11:30 PM
Userform Controls Nigel Excel Programming 5 December 30th 04 01:49 PM
Help please with UserForm controls sa3214 Excel Programming 4 July 2nd 04 03:00 AM
userform frame control Jo[_4_] Excel Programming 2 September 20th 03 12:38 AM


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