Opening protected workbooks

As part of testing my current project several users supplied workbooks that they currently use.

Most of these were ok, and the component did it’s thing very well.

However, some of the workbooks had protection by password, and the component completely failed to open them.

I understand that there have been questions on this before, and I was wondering if you have had a chance to look into the issue and were in a position to estimate when this facility would be available.

Thanks

Alan.

Hi Alan,

We have investigated this feature before but unfortunately we still don’t have a plan for this feature. The encrypt/decrypt algorithm under protected workbooks is unclear to us because of lack of documentation.

@AlanMullett,
Aspose.Cells is the latest product that has replaced Aspose.Excel and contains lot of advanced features to protect/unprotect workbooks, worksheets, apply advance protection settings since Excel XP, detect if worksheet is a password protected and encrypt excel files. Following sample code demonstrates the feature to open a password protected workbook.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET

// Specify password to open inside the load options
LoadOptions opts = new LoadOptions();
opts.Password = "1234";

// Open the source Excel file with load options
Workbook workbook = new Workbook(dataDir + "sampleBook.xlsx", opts);

// Check if 567 is Password to modify
bool ret = workbook.Settings.WriteProtection.ValidatePassword("567");
Console.WriteLine("Is 567 correct Password to modify: " + ret);

// Check if 5679 is Password to modify
ret = workbook.Settings.WriteProtection.ValidatePassword("5678");
Console.WriteLine("Is 5678 correct Password to modify: " + ret);

For more details about these features, please refer to the following documents:
Check Password to modify using Aspose.Cells
Protecting and Unprotecting Workbooks
Protecting Worksheets
Unprotect a Worksheet
Advanced Protection Settings since Excel XP in Aspose.Cells
Detect if Worksheet is Password Protected
Encrypting Excel Files in Aspose.Cells

You can download the latest version of this product here:
Aspose.Cells for .NET (Latest Version)

You can download a working solution here to test the features of this product.