Exiting a workbook

R

Risky Dave

Hi all,

Nearly finished what for me is a fairly major piece of work and the last
thing I am doing is locking down the workbook so that users cannot
accidentally change anything they shouldn't.

So, under Vista on XL 2007, I have:
1) Password protected the VB work area (sorry - don't know what this is
correctly called). I am aware that XL password protection is not strong -
this doesn't matter as I am only protecting against casual/accidental damage,
not a conscious malicious attack;
2) Disabled right-click mouse functionality;
3) Turned off the ribbon.

Two questions:
1) Is there anything else I should do to prevent accidental corruption of
data (system backups, duplication etc. is already taking place)?
2) I want to be able to hide the "x" button that exits MS applications so
that users are forced to leave the workbook using my own exit button (this
allows me to automatically do some housekeeping before the application
closes). Is there any way of doing this - switching off the ribbon does not
seem to affect it?

TIA

Dave
 
P

Per Jessen

Hi Dave

Maybe you could use a Workbook_BeforeClose event to call your housekeeping
code if the user don't use your button.

As it's an event code it goes into the code sheet for ThisWorkbook.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call HouseKeeping
End Sub

Regards,
Per
 
R

Risky Dave

Per,

Thanks.

Hadn't realised that you could do that - worked exactly as I need

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top