View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default UserForm not displaying

Maybe turning on screenupdating before you show the form would help.

By the way, your ScreenUpdating line is not doing what you want. VBA is seeing
it as an undeclared variable.

You'll want to use:

application.screenupdating = false
...
load userform2
application.screenupdating = true
userform2.show



dim wrote:

Hi,
I have this auto open code in Book2. Everything is executing ok except for
the Userform reference at the end. The userform is not loading...any ideas?
Thanks.

Sub auto_open()
ScreenUpdating = False
Windows("Book1.xls").Activate
ActiveWorkbook.Close
Windows("Book2.xls").Activate
Sheets("Sheet1").Select
Load UserForm2
UserForm2.Show
End Sub


--

Dave Peterson