Aspose. Cells Read protected password Excel file

  • 2021-08-03 09:52:25
  • OfStack

Recently, I encountered a requirement. To be able to read the contents of password-protected Excel, I used to read the data in Excel directly without any other processing.

When Excel is double-clicked, you need to enter a password, and an error will be reported when you use Aspose. Cells component to read it


Workbook book = new Workbook(fullFilename, new LoadOptions() { Password="111111" });
      
Worksheet sheet = book.Worksheets[0];
Cells cells = sheet.Cells;

When building Workbook object, there will be one parameter of LoadOptions, among which one attribute Password can be used to set and read passwords, which solves the problem perfectly.


Related articles: