0

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.

1
  • Why press the button programmatically? Will the user not click on the button? Please explain in detail as to what are you trying to achieve? Commented Feb 7, 2013 at 13:32

1 Answer 1

2

Use this code:

Sub myUserFormShow()
 myUserForm.Show
End Sub
Sign up to request clarification or add additional context in comments.

4 Comments

Would you know why msdn.microsoft.com/en-us/library/office/… does not work in my case?
Have no even slightest idea buddy. Being QA I'd ask for: "please provide more details relevant to the issue")
Do you know how to clck buttons programmatically? myUserForm.myButton1.Run and myUserForm.myButton1.Click do not compile.
@YuccaV I think this may help: mrexcel.com/forum/excel-questions/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.