Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I stop the close method in an auto close macro
I have an auto close macro running on a file that demands certain cells are
complete before closing. Is there a way of stopping the close method within the auto close macro when the data is not present. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I stop the close method in an auto close macro
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'do your test and if true Cancel = True End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Paul" wrote in message ... I have an auto close macro running on a file that demands certain cells are complete before closing. Is there a way of stopping the close method within the auto close macro when the data is not present. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I stop the close method in an auto close macro
Bob - many thanks for your help - this is absolutely what I needed.
"Bob Phillips" wrote: Private Sub Workbook_BeforeClose(Cancel As Boolean) 'do your test and if true Cancel = True End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Paul" wrote in message ... I have an auto close macro running on a file that demands certain cells are complete before closing. Is there a way of stopping the close method within the auto close macro when the data is not present. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Don't let user close. Use macro button to close? | Excel Programming | |||
In Before Close Sub ActiveWorkBook.Close(False) repeat procedure | Excel Programming | |||
Excel shoud not close all active books when clicking close button | Excel Discussion (Misc queries) | |||
excel - Windows close button (x) should only close active workboo. | Setting up and Configuration of Excel | |||
On Close Macro - stop warning message | Excel Programming |