This sets the workbook so that it can be opened in read-only mode with the option to open in read-write mode, if the user supplies a matching password when opening the spreadsheet.

<table class="wysiwyg-macro" data-macro-name="unmigrated-wiki-markup" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e3VubWlncmF0ZWQtd2lraS1tYXJrdXB9&amp;locale=en_GB&amp;version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>
 public System.String PasswordToModify{ set; }
</pre></td></tr></table>
<p>Public WriteOnly Property PasswordToModify() As String</p>
wb.PasswordToModify = "MyPassword";
wb.PasswordToModify = "MyPassword"