ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protection killed by sort button (https://www.excelbanter.com/excel-programming/344600-protection-killed-sort-button.html)

tykeinburton

Protection killed by sort button
 
Hi, I am working in Excel 2000.

I have a spreadsheet with one worksheet protected on open with
userinterfaceonly set to true to allow users to use the autofilters.

Users also need to use the sort function, so I have created a button
which simply calls the excel sort dialogue box. But when ok is pressed
on the dialogue box the protection on the worksheet has been removed.

Can anyone explain why this is happening, and suggest how to resolve
the issue, as we need the protection in place to prevent accidental
loss of data.

Thanks

Martin.


Norman Jones

Protection killed by sort button
 
Hi TykeInBurton,

I am able to replicate your experience in xl2000.

In your button code try something like:

Application.Dialogs(xlDialogSort).Show
ActiveSheet.Protect UserInterfaceOnly:=True, _
Password:="ABC"

---
Regards,
Norman



"tykeinburton" wrote in message
oups.com...
Hi, I am working in Excel 2000.

I have a spreadsheet with one worksheet protected on open with
userinterfaceonly set to true to allow users to use the autofilters.

Users also need to use the sort function, so I have created a button
which simply calls the excel sort dialogue box. But when ok is pressed
on the dialogue box the protection on the worksheet has been removed.

Can anyone explain why this is happening, and suggest how to resolve
the issue, as we need the protection in place to prevent accidental
loss of data.

Thanks

Martin.




tykeinburton

Protection killed by sort button
 
Thanks for that Norman, it works a treat

rgds

Martin



All times are GMT +1. The time now is 01:51 PM.

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