ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB Error 5 loading userform using Workbook_Open (https://www.excelbanter.com/excel-programming/399408-vbulletin-error-5-loading-userform-using-workbook_open.html)

rjchristensen

VB Error 5 loading userform using Workbook_Open
 
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


Crowbar via OfficeKB.com

VB Error 5 loading userform using Workbook_Open
 
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

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200710/1



All times are GMT +1. The time now is 12:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com