PC Review


Reply
Thread Tools Rate Thread

Adding an Object to a MultiPage

 
 
=?Utf-8?B?QnJhbmR0?=
Guest
Posts: n/a
 
      19th Nov 2006
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 With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      19th Nov 2006
Set NewOptBtn = _
MyForm.Designer.Controls("MultiPage1").Pages(0).Add("forms.OptionButton.1")

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

Regards,
Peter T

"Brandt" <(E-Mail Removed)> wrote in message
news73F4F50-AB40-40DD-A91C-(E-Mail Removed)...
> 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 With Quote
 
=?Utf-8?B?QnJhbmR0?=
Guest
Posts: n/a
 
      19th Nov 2006
Thank You Peter

"Peter T" wrote:

> Set NewOptBtn = _
> MyForm.Designer.Controls("MultiPage1").Pages(0).Add("forms.OptionButton.1")
>
> Assuming "Page1" is the first page its index is 0
>
> Regards,
> Peter T
>
> "Brandt" <(E-Mail Removed)> wrote in message
> news73F4F50-AB40-40DD-A91C-(E-Mail Removed)...
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
insert as an object in multipage pdf file cayce Microsoft Powerpoint 2 4th Sep 2008 03:17 PM
change from page1 to page2 of MultiPage object BigDave Microsoft Excel Programming 1 21st Nov 2005 05:59 PM
Inserting a multipage Word Doc using Insert/Object =?Utf-8?B?TWF0dA==?= Microsoft Word Document Management 3 16th Mar 2005 04:15 PM
Creating an Object on a Multipage Michael Microsoft Excel Programming 0 14th Dec 2004 11:33 PM
Multipage Object on User Form Paul Cheers Microsoft Excel Programming 2 27th Nov 2003 11:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:08 AM.