ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Exiting a workbook (https://www.excelbanter.com/excel-programming/416935-exiting-workbook.html)

Risky Dave

Exiting a workbook
 
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

Per Jessen

Exiting a workbook
 
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

"Risky Dave" skrev i meddelelsen
...
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



Risky Dave

Exiting a workbook
 
Per,

Thanks.

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

Dave

"Per Jessen" wrote:

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

"Risky Dave" skrev i meddelelsen
...
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




Per Jessen

Exiting a workbook
 
Hi Dave

Thanks for your reply. I'm glad to help.

Per

"Risky Dave" skrev i meddelelsen
...
Per,

Thanks.

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

Dave





All times are GMT +1. The time now is 12:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com