customise the "close workbook" cross at top right

philR

Active Member
Joined
Feb 25, 2002
Messages
257
Is it possible to customize what happens when the cross at the top right of a workbook is clicked?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

s-o-s

Active Member
Joined
Apr 14, 2002
Messages
384
Hi,

Yes by using the workbook before close event you can run any macro you choose before closing a book.

Therefore you can do anything that is possible with macro's

In the "This Workbook Module" the event is

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)

' Do your customising here


End Sub
 

philR

Active Member
Joined
Feb 25, 2002
Messages
257
Thanks Sean.
I realised what a dumb question it was after I had posted it. Ahh well.

Phil.
 

Forum statistics

Threads
1,144,354
Messages
5,723,884
Members
422,524
Latest member
wirkkarn

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
Top