Description
SpreadsheetGear supports reading and writing password-protected and encrypted workbooks with Agile Encryption used by Excel 2013 and later, including default SHA-512 encryption for workbooks.
For non-encrypted / non-password protected workbooks you would typically open these using the SpreadsheetGear.Factory.GetWorkbook(...) method, but GetWorkbook(...) does not have an overload to accept a password. For password-protected workbooks you must first create an IWorkbookSet object and then call IWorkbookSet.Workbooks.Open(string pathToFile, string password).
This sample demonstrates opening a password-protected workbook (protected with the password "MyPassword123"). It then sets a cell value with the current date and time to prove that the file was opened and modified, then saves the file again. Once you download the resultant file you can open it in Excel, which will prompt you to enter the password, where you should see the date/time that we added to the file.