Auto Open Userform

chrisguk

Board Regular
Joined
Jan 10, 2011
Messages
135
Hi there,

I have a userform1 in my workbook and created the following code to auto open it when the workbook starts up. The only problem is the userform does not open and I cant understand why:

Private Sub Workbook_Open()
userform1.show
End Sub

Any ideas? for the record im using MS Excel 2007
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Have you got Events enabled? Check via the Immediate Window in the VBE: open it with Ctrl+G and type in

?Application.EnableEvents

and check it returns True
 
Upvote 0
Hi Richard,

It does return true.

Have I put the code in the right place within the VBE area?
 
Upvote 0
Assuming you have that sub in the ThisWorkbook module then it is definitely in the right place. I'm not sure why it wouldn't be working - it certainly did for me in testing!
 
Upvote 0
Nope, that shouldn't effect it. What are your security settings? Do you get asked to enable macros (and presumably you click to Enable rather than disable)?
 
Upvote 0
Humour me by inserting a standard module (or use an existing one) and amending the workbook_open code to:

Code:
'In ThisWorkbook module:


Private Sub Workbook_Open()
Call   Open_My_Userform1
End Sub


'In STANDARD module:

Sub Open_My_Userform1()
userform1.show
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,424
Members
452,914
Latest member
echoix

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top