Yulia V
Yulia V

Reputation: 3559

excel vba userforms: user-defined type not defined

My Excel book contains a user form called myUserForm. I want to open it, fill it with data and programmatically press its buttons, but

Sub myUserFormShow()
 Dim muf As myUserForm
 muf.Show
End Sub

prompts an error User-defined type not defined. How to fix it? Thanks.

Upvotes: 0

Views: 1800

Answers (1)

Peter L.
Peter L.

Reputation: 7304

Use this code:

Sub myUserFormShow()
 myUserForm.Show
End Sub

Upvotes: 2

Related Questions