Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to run the code assigned to commandbutton1 on userform1
without opening the userform? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need to load the form into memory, but not show it.
Sub AAA() Load UserForm1 UserForm1.CommandButton1_Click End Sub In the userform's code module, change the command button's Click procedure from Private to Public. Cordially, Chip Pearson Microsoft Most Valuable Professional, Excel, 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com On Tue, 11 May 2010 12:25:01 -0700, ordnance1 wrote: Is it possible to run the code assigned to commandbutton1 on userform1 without opening the userform? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What do you mean by open?
If you mean load it into memory, then nope. You have to do that. If you mean display it to the user, then you can run the code without doing that. I create a small userform with a single commandbutton on it. This was the code that was behind that userform: Option Explicit Private Sub CommandButton1_Click() MsgBox "hi" End Sub Then I created a subroutine in a general module that looked like: Option Explicit Sub testme() Load UserForm1 UserForm1.CommandButton1.Value = True Unload UserForm1 End Sub ordnance1 wrote: Is it possible to run the code assigned to commandbutton1 on userform1 without opening the userform? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
flash movie on userform doesn't play when code is running | Excel Programming | |||
UserForm Shown while Program is Running other Code | Excel Programming | |||
while my c# code running ,clicks on excel document interrupts code | Excel Programming | |||
Excel97: Show UserForm while running code? | Excel Programming | |||
Problem running code behind a userform | Excel Programming |