Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does anyone know how to use vba code to disable the X to close button on an open workbook. I have placed a command button on a worksheet and do not want the user to be able to close the workbook without clicking the command button.
|
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Place in the ThisWorkbook module: Private Sub Workbook_BeforeClose(Cancel As Boolean) Cancel = True End Sub Now the workbook can't close at all. You take it from there. HTH. Best wishes Harald "Eric" skrev i melding ... Does anyone know how to use vba code to disable the X to close button on an open workbook. I have placed a command button on a worksheet and do not want the user to be able to close the workbook without clicking the command button. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Attach button disabled | Excel Discussion (Misc queries) | |||
Blog Category button disabled | Excel Discussion (Misc queries) | |||
make button invisible if macros disabled | Excel Discussion (Misc queries) | |||
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 |