Object required Error

jsambrook

Board Regular
Joined
Feb 1, 2010
Messages
214
Good Morning all!
I am trying to launch a form, which I had working successfully and cannot work out for the life of me what I have done to break it. I cant even get it to launch the form, it comes up with Object Required and it highlights the row NewStaffForm.Show of the macro

Private Sub CommandButton1_Click()
NewStaffForm.Show
End Sub

My Form is definitely called NewStaffForm
Anybody any ides what I'm doing wrong?
 
All sorted and working great! Thanks so much guys!
One more quick question. Once the info has been inserted into form, how do I get the form to close without pressing cancel? O do I just use the unload me at the end of the code?
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Sorry for being a total dunce, but how do I add option explicit? simply write it?
Yes, simply place those two words on a line on their own as the first line of the module.

In VBA, go Tools > Options > Editor, and tick Require Variable Declaration, then VBA will insert it automatically in every module you create.
 
Upvote 0

Forum statistics

Threads
1,225,156
Messages
6,183,233
Members
453,152
Latest member
ChrisMd

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