PDA

View Full Version : [SOLVED:] how to startup excel with a form



huckduck
07-05-2005, 09:03 PM
Is it possible to start a form automatically, when opening a workbook?

Jacob Hilderbrand
07-05-2005, 09:22 PM
Yup, just put the code in the Workbook Open event.

In the VBE Project Explorer, look for ThisWorkbook. Then Select Workbook from the left drop-down in the code window, and Open (which is default in this case) from the right drop-down.

sheeeng
07-05-2005, 09:26 PM
Like this....just to add to what DRJ had replied...

In VBE Project Explorer, look for ThisWorkbook, put this code in it...
Remember to add a new userform....on a new workbook



Private Sub Workbook_Open()
Load UserForm1
UserForm1.Show
End Sub

Bob Phillips
07-06-2005, 02:49 AM
Private Sub Workbook_Open()
Load UserForm1
UserForm1.Show
End Sub


You don't need to load it and show it, the show will automatically load if it is not already in memory.

You only need to load explicitly if you want to set some form properties from outwith the form code.