Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks!
"Jacob Skaria" wrote: From workbook launch VBE using short-key Alt+F11. On the left treeview for this project double click 'This Workbook' and paste the code to the code panel. Private Sub Workbook_BeforeClose(Cancel As Boolean) If MsgBox("Update File?", vbYesNoCancel + vbQuestion, "File Update") _ < vbYes Then Exit Sub 'Run file update code MsgBox "File Updated" End Sub If this post helps click Yes --------------- Jacob Skaria "Al" wrote: Hello I would like to run this code before the file is closed. Sub Update() Msg = "Update File?" Title = "File Update" Response = MsgBox(Msg, vbYesNoCancel + vbQuestion, Title) If Response = vbNo Then Exit Sub End If If Response = vbCancel Then Exit Sub End If Run file update code MsgBox "File Updated" End Sub How do I do this? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I stop the close method in an auto close macro | Excel Programming | |||
Don't let user close. Use macro button to close? | Excel Programming | |||
Do I have to close an odc in a macro? | Excel Programming | |||
Run Macro on close | Excel Programming | |||
On Close macro | Excel Programming |