Sets or returns the password used to encrypt the spreadsheet. Standard "Office 97/2000 Compatible" encryption is used to encrypt the spreadsheet. This is the default encryption used by Excel 97 and later versions.

 public System.String EncryptPassword{ get; set; }
Public Property EncryptPassword() As String

To further protect your spreadsheet, you can protect the workbook structure using the Workbook.Protect() method or write-protect individual worksheets using the Worksheet.Protect() method.


          //--- Get the EncryptPassword value for the workbook
          string pwd = wb.EncryptPassword;

          //--- Set the EncryptPassword value for the workbook
          wb.EncryptPassword = "MyPassword";
        

          '--- Get the EncryptPassword value for the workbook
          Dim pwd As String = wb.EncryptPassword

          '--- Set the EncryptPassword value for the workbook
          wb.EncryptPassword = "MyPassword"