ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet Password Protection in VBA (https://www.excelbanter.com/excel-programming/296086-worksheet-password-protection-vba.html)

Graham[_5_]

Worksheet Password Protection in VBA
 
Hi,

I have a workbook in which users are inputting data via
user forms. Each time data is entered, or the file changed
I am protecting the sheets, but without a password, using
the following script.

ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True

Is there script (or other method) that I can use to assign
a password so that the worksheets are protected with
password and cannot be amended by simply clicking
ToolsUnprotect Worksheet?


Help gratefully received

Vasant Nanavati

Worksheet Password Protection in VBA
 
ActiveSheet.Protect "MyPassword"

--

Vasant



"Graham" wrote in message
...
Hi,

I have a workbook in which users are inputting data via
user forms. Each time data is entered, or the file changed
I am protecting the sheets, but without a password, using
the following script.

ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True

Is there script (or other method) that I can use to assign
a password so that the worksheets are protected with
password and cannot be amended by simply clicking
ToolsUnprotect Worksheet?


Help gratefully received





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

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