Unload userform help

andyt2005

Board Regular
Joined
Jul 20, 2014
Messages
50
Morning all, Im trying to get a workbook to close when the user clicks the 'x' on the userform which i can do no issues, The issue lies in another command i use to unload the userform. Im sure you can all guess what happens :( Is there any way around this? ATM when the user clicks the 'x' it checks to see if any other workbooks are open and if not it quits excel but if there are other workbooks open it closes the workbook containing the userform but leaves the others open.Any ideas or help?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
this work for you:
Code:
ActiveWorkbook.Close True

closed only my active one even when the X is clicked
 
Upvote 0
no joy :( So baisically i have user form load up on start, and an option to 'login'i want it so that if the user clicks the 'X' then it will close/quit. However if a user logs in i just want the user form to 'unload' this is where it goes wrong, when the form unloads it closes/quits the workbook because the user form has been terminated
 
Upvote 0

Forum statistics

Threads
1,214,624
Messages
6,120,591
Members
448,973
Latest member
ksonnia

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