Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using the Auto_Close procedure to perform several
actions before the workbook is closed. I no want to add one hich checks if a specific field has been filled in. If it has not, I want the Workbook not to close. Any ideas? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try the following procedure in your workbook module (not in a standard module): Private Sub Workbook_BeforeClose(Cancel As Boolean) with me.worksheets("sheet1").range("A1") if .value="" then msgbox "cell A1 on sheet1 not filled, cancel closing" cancel=true exit sub end if end with 'now your code End Sub -- Regards Frank Kabel Frankfurt, Germany Keefy Boy wrote: I am using the Auto_Close procedure to perform several actions before the workbook is closed. I no want to add one hich checks if a specific field has been filled in. If it has not, I want the Workbook not to close. Any ideas? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Great, thanks. I was working in a standard module.
All works well now, cheers -----Original Message----- Hi try the following procedure in your workbook module (not in a standard module): Private Sub Workbook_BeforeClose(Cancel As Boolean) with me.worksheets("sheet1").range("A1") if .value="" then msgbox "cell A1 on sheet1 not filled, cancel closing" cancel=true exit sub end if end with 'now your code End Sub -- Regards Frank Kabel Frankfurt, Germany Keefy Boy wrote: I am using the Auto_Close procedure to perform several actions before the workbook is closed. I no want to add one hich checks if a specific field has been filled in. If it has not, I want the Workbook not to close. Any ideas? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Closing workbooks w/o closing Excel | Excel Discussion (Misc queries) | |||
Closing excel | Excel Worksheet Functions | |||
Closing Excel | Excel Discussion (Misc queries) | |||
closing Excel in VBA | Excel Programming | |||
closing excel after closing a workbook | Excel Programming |