Disable close button in excel 97 
Author Message
 Disable close button in excel 97

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



Sat, 17 Jan 2004 23:27:06 GMT  
 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



Sun, 18 Jan 2004 00:15:54 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Disable Access Close Button not Form Close Button?

2. Disabling Access 97 application close button

3. Disable Close Button of an Excel sheet

4. disable the close button on top of excel 2000....URGENT

5. Disabling close button on Excel workbook window

6. Disabled Close button / What's this button

7. The Close (x) button is greyed out in Excel (97 and 2000 version_

8. Missing close button in EXCEL 97

9. Greyed out Close Button in Excel 97- Win98

10. Problem with closing Excel with the close button


 
Powered by phpBB® Forum Software © phpBB Group