Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Adding an Object to a MultiPage

I can add an optionbutton to a UserForm via the code below. What I am trying
to do, however, is to add the option button to "Page1" of "MultiPage1" of
"UserForm1". I can't seem to get this to work. Any Ideas?

Thanks

Sub AddOptionButton()
Dim MyForm
Dim NewOptBtn As Msforms.OptionButton

Set MyForm = ThisWorkbook.VBProject.VBComponents("UserForm1")
Set NewOptBtn = MyForm.Designer.Controls.Add("forms.OptionButton.1 ")
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Adding an Object to a MultiPage

Set NewOptBtn = _
MyForm.Designer.Controls("MultiPage1").Pages(0).Ad d("forms.OptionButton.1")

Assuming "Page1" is the first page its index is 0

Regards,
Peter T

"Brandt" wrote in message
...
I can add an optionbutton to a UserForm via the code below. What I am

trying
to do, however, is to add the option button to "Page1" of "MultiPage1" of
"UserForm1". I can't seem to get this to work. Any Ideas?

Thanks

Sub AddOptionButton()
Dim MyForm
Dim NewOptBtn As Msforms.OptionButton

Set MyForm = ThisWorkbook.VBProject.VBComponents("UserForm1")
Set NewOptBtn = MyForm.Designer.Controls.Add("forms.OptionButton.1 ")
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Adding an Object to a MultiPage

Thank You Peter

"Peter T" wrote:

Set NewOptBtn = _
MyForm.Designer.Controls("MultiPage1").Pages(0).Ad d("forms.OptionButton.1")

Assuming "Page1" is the first page its index is 0

Regards,
Peter T

"Brandt" wrote in message
...
I can add an optionbutton to a UserForm via the code below. What I am

trying
to do, however, is to add the option button to "Page1" of "MultiPage1" of
"UserForm1". I can't seem to get this to work. Any Ideas?

Thanks

Sub AddOptionButton()
Dim MyForm
Dim NewOptBtn As Msforms.OptionButton

Set MyForm = ThisWorkbook.VBProject.VBComponents("UserForm1")
Set NewOptBtn = MyForm.Designer.Controls.Add("forms.OptionButton.1 ")
End Sub




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
change from page1 to page2 of MultiPage object BigDave[_27_] Excel Programming 1 November 21st 05 05:59 PM
Adding frame on multipage through code... Ajit Excel Programming 1 January 5th 05 06:57 PM
Creating an Object on a Multipage Michael[_35_] Excel Programming 0 December 14th 04 11:33 PM
Check for any data changes in a form with multipage object Bert Neuenschwander Excel Programming 2 September 24th 04 06:31 AM
Multipage Object on User Form Paul Cheers Excel Programming 2 November 27th 03 11:40 AM


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