Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{description}
{excerpt}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.{excerpt}
{signature:C#}
 public System.String EncryptPassword{ get; set; }
{signature}{signature:vb.net}
Public Property EncryptPassword() As String
{signature}
{remarks}
To further protect your spreadsheet, you can protect the workbook structure using the [Workbook.Protect()|Workbook.Protect(String)] method or write-protect individual worksheets using the [Worksheet.Protect()|Worksheet.Protect(String)] method.
{remarks}
{example}{code:csharp|title=C#}

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

          //--- Set the EncryptPassword value for the workbook
          wb.EncryptPassword = "MyPassword";
        {code}
{code:vb.net|title=vb.net}

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

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

{example}