excel exit

cole7011

New Member
Joined
Oct 19, 2004
Messages
37
whats the vb code, for exit excel,

so i could place it at the end of a vb statement and when ran it would close the current open worksheet....

thanks
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Do you want to totally close Excel or just the active workbook?

Totally close Excel : Application.Quit

Close active workbook: ActiveWorkbook.Close
 
Upvote 0
In addition to what Norie said, Activeworkbook.Close True will save the wb, Activeworkbook.Close False won't.

Hope that helps,

Smitty
 
Upvote 0

Forum statistics

Threads
1,203,263
Messages
6,054,441
Members
444,725
Latest member
madhink

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