ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protect selected sheet(s) (https://www.excelbanter.com/excel-programming/356328-protect-selected-sheet-s.html)

Kevin McCartney

Protect selected sheet(s)
 
Hi

I've written some code that is supposed to protect a group of selected
sheets but I get an error 1004: Method 'Protect' of object '_Worksheet'
failed. Is this because you can only protect a sheet when there is only one
sheet selected, in that the protection of sheet can not be performed when
multiple sheets are selected. If this is the case then I'll store the sheet
indexes in an array and protect them one by one and then reselect them once
done.

TIA
KM

Tom Ogilvy

Protect selected sheet(s)
 
Yes, protect sheet by sheet.

--
Regards,
Tom Ogilvy


"Kevin McCartney" wrote:

Hi

I've written some code that is supposed to protect a group of selected
sheets but I get an error 1004: Method 'Protect' of object '_Worksheet'
failed. Is this because you can only protect a sheet when there is only one
sheet selected, in that the protection of sheet can not be performed when
multiple sheets are selected. If this is the case then I'll store the sheet
indexes in an array and protect them one by one and then reselect them once
done.

TIA
KM



All times are GMT +1. The time now is 08:01 AM.

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