![]() |
|
#5
|
|||
|
|||
|
as logit has said the beforeClose thisworkbook is ideal for what you want, but you dont need to ask the user to do anything.
If you open the this workbook Module in the VBA editor you will see drop downs at the top the one on the left (general) can be changed to Workbook (it acts when the workbook does something). The one on the right is the thing that happens - there is quite a few, but some are really obvious like BeforeClose. Select BeforeClose and a automated Private Sub will open called Workbook_BeforeClose In between the 2 lines put in anythng you want to happen before the workbook is closed, for example Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
Worksheets("Form").Protect
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Command button. To multi command | Taylormations | Word VBA | 11 | 09-14-2020 02:39 AM |
| How do I un-protect docs I didn't protect? | doctorduncan | Word | 4 | 05-30-2019 11:09 AM |
Outlook 2013 > Command to view the header without opening a suspicious message?
|
Macintosh | Outlook | 2 | 02-04-2019 05:38 PM |
| Show table list by using chek box command and save document on sharepoint by using command button | Zhibek | Word VBA | 3 | 08-16-2018 06:19 PM |
| Repair command results in error message | srdiamond | Office | 0 | 03-01-2011 12:13 PM |