PC Review


Reply
Thread Tools Rate Thread

HOW CAN I WRITE A CODE TO A COMMANDBUTTON CREATED PROGRAMMATICALLY

 
 
Kozete
Guest
Posts: n/a
 
      11th Jun 2008
My first question is how can I write a code to A CommandButton added by the
code below.

Private Sub Workbook_Open()

Set MyCommandButton = UserForm1.Controls.Add
("Forms.CommandButton.1", "CommandButton1" )

End Sub


My second question is, is there a way to create a UserForm programmatically?
(As my project above, I had to create a UserForm manually first and then
invoked the code above to add a CommandButton to my UserForm.)


--
Kozete
 
Reply With Quote
 
 
 
 
Rui
Guest
Posts: n/a
 
      11th Jun 2008
Kozete

Have a look at this page as I think it will answer both your questions.

http://www.tek-tips.com/faqs.cfm?fid=5757

Cheers
Rui

"Kozete" wrote:

> My first question is how can I write a code to A CommandButton added by the
> code below.
>
> Private Sub Workbook_Open()
>
> Set MyCommandButton = UserForm1.Controls.Add
> ("Forms.CommandButton.1", "CommandButton1" )
>
> End Sub
>
>
> My second question is, is there a way to create a UserForm programmatically?
> (As my project above, I had to create a UserForm manually first and then
> invoked the code above to add a CommandButton to my UserForm.)
>
>
> --
> Kozete

 
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
Programmatically press CommandButton donwb Microsoft Excel Programming 0 18th Jul 2009 11:14 PM
HOW CAN I WRITE A CODE TO COMMANDBUTTON ADDED AT RUNTIME? Kozete Microsoft Excel Programming 2 6th Jun 2008 05:22 PM
How to write output of aspx file created to HTML programmatically G Microsoft ASP .NET 2 18th Aug 2004 01:38 PM
How to write output of aspx file created to HTML programmatically G Microsoft ASP .NET 0 17th Aug 2004 09:14 PM
Programmatically write to app.config file in vb.net code jasiglam Microsoft VB .NET 4 25th Aug 2003 04:59 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:46 PM.