
Disable close button in excel 97
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Range("a1") = 1 Then Cancel = True
End Sub
I think this is giving you some ideas
When cancel = true you can't close the workbook so put in the code from the
button you use to save and close the file another value of a1.
In the workbook open event make the value 1 again so you cant use the close
button the next time you open the file
Regards Ron
Quote:
> I want to hide or disable the close button of a worksheet, so the users of
> the worksheet can only close the worksheet after saving it, they can save
> and then close by clicking a button that activates a macro that saves and
> then closes the worksheet.
> I don't know how to do this, can anyone give me a hint on how to solve
this
> problem
> Kind regards,
> Ralph
> --
> --------------------------------------------------------------------------
--
> -------------------------------------------------
> Ralph van Mulken Oc-Technologies B.V. Research &
> Development
> Adress: Oc R&D PO BOX 101 / 5900 MA Venlo The Netherlands
> Location: R&D-3B60 Department: EP1