View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Robert Crandal Robert Crandal is offline
external usenet poster
 
Posts: 309
Default Hiding a userform properly!

Please take a look at the code below which my workbook
is using:
'--------------------------------------------------------
Private Sub Workbook_Open()
Userform1.Show
End Sub
'-------------------------------------------------------
Private Sub UserForm_Initialize()
MsgBox "Initialize stuff here"
Userform1.Hide
MsgBox "Okay, form1 is hidden now!"
Userform1.Show
End Sub
'--------------------------------------------------------

So....obviously this code will not work. I'm guessing that
the second call to "Userform1.Show" is causing the program
to crash. I would like to temporarily hide the form and then
make it visible again. What am I doing wrong?

thanks!