ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protecting worksheet (https://www.excelbanter.com/excel-programming/296407-protecting-worksheet.html)

Shilps

Protecting worksheet
 
Hi
I have a worksheet that is used to display the data by selecting various options in the different controls. I want that no user is able to change anything except select different options. I first unlocked various objects and cells and password protected it( I do not want the code to be visible) but the problem is that even by first unlocking different cells and objects , the code is giving run-time error
Is there any solution to it
TI
Shilps

Bob Flanagan

Protecting worksheet
 
Shilps, copy your code into a post so we can see it. (do not attach a
workbook)

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Shilps" wrote in message
...
Hi,
I have a worksheet that is used to display the data by selecting various

options in the different controls. I want that no user is able to change
anything except select different options. I first unlocked various objects
and cells and password protected it( I do not want the code to be visible)
but the problem is that even by first unlocking different cells and objects
, the code is giving run-time error.
Is there any solution to it?
TIA
Shilps




Tom Ogilvy

Protecting worksheet
 
At the top of the code try putting in code like

ActiveSheet.Protect UserInterFaceOnly:=True

if you are using Excel 2002 or later, you need to include

ActiveSheet.Protect Password:="ABCD", UserInterFaceOnly:=True

otherwise, you have have your code unprotect the sheet, do its work,
reprotect the sheet.

--
Regards,
Tom Ogilvy

"Shilps" wrote in message
...
Hi,
I have a worksheet that is used to display the data by selecting various

options in the different controls. I want that no user is able to change
anything except select different options. I first unlocked various objects
and cells and password protected it( I do not want the code to be visible)
but the problem is that even by first unlocking different cells and objects
, the code is giving run-time error.
Is there any solution to it?
TIA
Shilps





All times are GMT +1. The time now is 11:14 PM.

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