Open an existing workbook that's password-protected

Aug 3, 2011 at 8:32 PM

Hi All,

Is there an example of how to password-protect/lock out changes on a workbook (so that the data validation and other settings can't be modified, while allowing data entry that meets the validation rules)?  Would the data on the sheets of the workbook be accessible , such as using

row.Cell(2).GetValue<decimal>()

to get the value even if the sheet or cells are password-protected (I'm not writing data to it after the password-protection is applied).  To be clear, I do not want a password  required to open the workbook, only to modify any cell protection or data validation.

 

Thanks

 

Steve

Coordinator
Aug 3, 2011 at 9:12 PM

Check out Sheet Protection. The values are available to you via code even if they're (password) protected.