PDA

View Full Version : userform close when i close another excel file



azizls4
08-04-2023, 08:27 AM
hello
I have UserForm, when I open another Excel file and then close it, UserForm closes automatically. Is there a code I add to UserForm that prevents it from being closed when I close another Excel file?
thank you

Aussiebear
08-04-2023, 01:35 PM
Welcome to VBAX azizis4. Can you post your code so we can see what you currently have?

azizls4
08-04-2023, 01:45 PM
I did not make a code for that, I want a code for that if possible, when I close another excel file, I do not want the userform to close with it

Aussiebear
08-05-2023, 03:57 AM
Have a look at the concept of making the Userform modeless

azizls4
08-06-2023, 12:46 AM
i tried to make a showmodal in the properties True and Fulse , but it did not work in the both way, I expect a bug in Excel 2016, unless there is code to solve this problem.

Aussiebear
08-06-2023, 04:21 AM
Have a look here, and make sure you read through to the bottom of the page to understand. Hopefully this will give you some ideas to try. https://excelmacromastery.com/vba-userform/