Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

I can't open another excel file when userform is active

0

Why I'm not able to open another excel file(to refer some data)while data entry to my userform? is it supposed to be like that?

Answer
Discuss

Answers

1

Yes. When a user form is opened that form takes ocntrol and will retain control until it is hidden or unloaded.

This is caused by the default parameter 'vbModal' as in

UserForm1.Show vbModal
You don't have to add this parameter in your code because VBA will presume it is there. However, if you wish to show the form and still be able to use Excel you should show it modeless, like this.
UserForm1.Show vbModeless
Don't shout "Eureka" yet. There are drawbacks to working with modeless forms (which is why MS made modal the default). Consider, instead, to either open the other workbook before you show the form or have the form's VBA open it for you.
Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login