Error 91 Object required

TheMathLab

New Member
Joined
Jul 16, 2018
Messages
7
Good morning!

I'm having an issue. I have looked through the threads and through google and done what it has told me to do, but the error is still popping up.

I have a userform (UserForm1) that has three buttons on it:

NewEntryBtn shows UserForm2 and unloads UserForm1
FinBtn shows UserForm3 and unloads UserForm1
BackdoorBtn activates Sheets("Job List") and unloads UserForm1

Each of these bring up the error. The code (below) is placed inside the UserForm1 code

My attempt at the solution (Note, I am not worrying here about loading the other userforms because that doesn't seem to be an issue):

Instead of just
Code:
Private Sub NewEntryBtn_Click()
   Unload UserForm1
End Sub

I have tried
Code:
Private Sub NewEntryBtn_Click()
   Set frm1 = UserForm1
   Unload frm1
End Sub

and
Code:
Private Sub NewEntryBtn_Click()
   Dim frm1 as UserForm
   Set frm1 = UserForm1
   Unload frm1
End Sub

Neither works.

Any help?

Thanks!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I've figured it out!
I was wrong. It wasn't the Unload Me that was giving the Error 91.
I had a UserForm_Initialize() sub that ended with userform1.show, which apparently doesn't work because userform_initialize() has already taken care of it.
Is that right?
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,239
Members
452,621
Latest member
Laura_PinksBTHFT

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