WorkBook_Close() problem

Always_A_Newbie_2

Board Regular
Joined
Feb 25, 2004
Messages
69
Hi, hopefully someone can answer this easily.

I use WorkBook_Open() as the sub name and it's called everytime the sheet opens. Now I want one for when the Workbook closes.
I tried WorkBook_Close() but it doesn't seem to be called when I 'X' it. And for some reason, inside VBA that stupid little paperclip can't find the words "WorkBook_Open" even though they seem to be a VBA built in statement.

Any ideas?
Thanks again.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
That's because it is called Workbook_BeforeClose, i.e.

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
...
End Sub

If you go into you VB editor, click on the ThisWorkbook module, there will be two drop down boxes above the code window. In the left drop down box, select Workbook. Then look at the right drop down box. This will show you all the options/events.
 
Upvote 0
No problem. Also check out the edit I made to the previous post. I added another paragraph at the end.
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,573
Members
452,652
Latest member
eduedu

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