VB Error 5 loading userform using Workbook_Open

R

rjchristensen

I'm new to writing VBA for the Excel environment so bear with me. I
am trying to get a user form called "DispBoard" to load/display using
the Workbook_Open area and I keep getting the VB Runtime Error 5. The
code was added the the "ThisWorkbook" section of Microsoft Excel
Objects in the VBA project. I tried both of the following calls and
they both produce the same error. Any suggestions would be most
appreciated.

Thanks,

Rich

Example 1:
======================
Private Sub Workbook_Open()
DispBoard.Show
End Sub


Example 2:
======================
Load DispBoard
Private Sub Workbook_Open()
DispBoard.Show
End Sub
 
C

Crowbar via OfficeKB.com

I've never experienced any problems with this.

Maybe your userform isn't called dipboard?

Maybe its the CAPTION of the userform you have named and NOT the (name) of
the userform.

Try this

Sub Auto_Open

Userform1.show
'Or
'Load Userform1

'Or change userform1 to dipboard

End Sub

If this isn't your problem I will be stumpt, unless you have imported the
userform
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top