Difference between Query_Close and Terminate Events

kpark91

Well-known Member
Joined
Jul 15, 2010
Messages
1,582
Hello,

I've been working with userforms for quite some time now
and I was wondering what the difference between Query_Close and Terminate events of the userforms.

I know Query_Close has Cancel and CloseMode variables while Terminate doesn't but are there any other differences?

Thank you in advance,
kpark.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
QueryClose happens first to allow you to decide whether to unload or not.
 
Upvote 0
I'm not sure what you mean by that.

Could you expand on it?

Thanks so much for the response :)
 
Upvote 0
When you try to close the form, the QueryClose event occurs first. It gives you the Cancel and CloseMode arguments so that you can determine whether to unload the form or not. If you allow it to proceed then the terminate event happens when the form is unloaded - you can't cancel that.
 
Upvote 0

Forum statistics

Threads
1,224,550
Messages
6,179,459
Members
452,915
Latest member
hannnahheileen

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