Excel vba-when i opened a new excel using useform it closes along with the userform

happycode

New Member
Joined
Aug 25, 2020
Messages
5
Office Version
  1. 2010
Platform
  1. Windows
Hi,
I have created a userform in a workbook named some 'x'. I made the userform to run automatically when this 'x' workbook opens by giving application.visible= false and userform.show.
I am validating some data in this user form using command buttons. Finally i want to open a validated workbook which will be created in the same location of the 'x' workbook. I kept a command button as open validated file and opened the validated file. But i dont want to close it. I just want to remain it opened and close only the user form and the 'x' workbook.
Even after closing the 'x' workbook i want the validated file to be opened only.
Please advise. Your comments are really appreciated.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try opening the userform "modelessly":
VBA Code:
UserFormXYZ.Show vbModeless
Bye
 
Upvote 0
Try opening the userform "modelessly":
VBA Code:
UserFormXYZ.Show vbModeless
Bye
Even if i use modelessly, the opened validated file closes when the userform workbook is closed. I just want to have the final output workbook to be opened and do not close it.could you please help on this.
Thanks for posting!
 
Upvote 0
My guess is that the problem depends on how you close the userform and the "X" workbook. Please describe which is your process about that, as well as list the code that manages the userform events (especially UserForm_Deactivate and UserForm_Terminate) and any code you use to close workbook X

Bye
 
Upvote 0
My guess is that the problem depends on how you close the userform and the "X" workbook. Please describe which is your process about that, as well as list the code that manages the userform events (especially UserForm_Deactivate and UserForm_Terminate) and any code you use to close workbook X

Bye
I did not used terminate or deactivate events. I just used another command button to close the userform and workbook 'x'.
And i used queryclose to make the workbook opened for future code edit purpose.
Is there any other way to open a outpur result and leave it. And close only the userform and workbook 'x'.?
 
Upvote 0
Ok, so you close the other workbook with another button; whould you please show the code that you use for that operation? My guess is that somewhere you "quit" the excel application, but if you don't show what you use I shall stay with my guess and you stay with your problem ;)
 
Upvote 0

Forum statistics

Threads
1,213,557
Messages
6,114,288
Members
448,563
Latest member
MushtaqAli

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top