Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2013 VBA: error on UserfForm1.show

Status
Not open for further replies.

pendle666

Technical User
Jan 30, 2003
295
0
0
GB
Hello

I'm getting back into doing some simple VBA with userforms in Excel.

My userform is called UserForm1 and in my Excel worksheet I have a command button which on click runs the following

Private Sub CommandButton1_Click()
UserForm1.Show
End Sub



However, when I try and run this I an error message: Runtime error 424: Object Required.

I've checked the name and UserForm1 is correct, so I've no idea where I've gone wrong.


Pendle

thank you for helping

____________
Pendle
 
Try using
Me.Show

instead of UserForm1.Show

Chris

-------------------------------------------------------------
"Don't be deceived. We're all temporary employees.
 
Hi

Me.Show isn't actually an option, there's Me.ShowDataForm or Me.ShowAllData

and neither of them worked either. I've had a browse round on Google, and it's all UserForm1.Show, unless there's a problem with the settings here at work. I shall try at home later on.



thank you for helping

____________
Pendle
 
Where does UserForm1 reside? Is it in the workbook with the command button, another workbook, or an add-in?

Chris

-------------------------------------------------------------
"Don't be deceived. We're all temporary employees.
 
It's in the workbook workbook.xlsm under Forms and the command button macro is in Microsoft Excel Objects under Sheet 1

thank you for helping

____________
Pendle
 
As a test, I created a userform called UserForm1 in a workbook. In the same workbook, I placed an ActiveX button on Sheet1. In the code for Sheet1 I placed:

Code:
Private Sub CommandButton1_Click()
    UserForm1.Show
End Sub

When I click the button, the form appears.
Are you doing anything different than that?


Chris

-------------------------------------------------------------
"Don't be deceived. We're all temporary employees.
 
There must be something wrong with the userform itself - or a corruption somewhere because I just tried a new userform in a new workbook and it's worked just fine.

Thanks for your help - I'll start over what I'm doing, I could do with the practice!!


thank you for helping

____________
Pendle
 
I feel your pain. I don't know how many hours I've wasted because of a corrupted cell in a spreadsheet. It was before I knew about these forums and I knew something was bad when I tried to run a macro and it would crash Excel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top