Aspose.Cells.NET 8.6 Cannot read some password protected files

I am having problems reading certain password protected XLS files that we receive from certain sources. I’ve tried using the latest version 8.6 of Aspose.Cell for .NET and it still has the same problem. An example of such a file is attached and the problem can easily be reproduced with the following code:

LoadOptions loadOptions = new LoadOptions();
loadOptions.Password = “abc123”;
Workbook wb = new Workbook(“calger.xls”, loadOptions);

I get an “Invalid password” exception. The first 4 lines of the stack trace below also contained some gibberish characters which got lost in the copy-paste:

Aspose.Cells.CellsException was unhandled
HResult=-2146232832
Message=Invalid password.
Source=Aspose.Cells
StackTrace:
at ‰..ž(ˆ )
at ‰..€š(MemoryStream )
at ‰..š( )
at ‰..Read( )
at Aspose.Cells.Workbook.Ÿ(Stream , LoadOptions , Boolean )
at Aspose.Cells.Workbook.Ÿ(String , LoadOptions )
at Aspose.Cells.Workbook…ctor(String file, LoadOptions loadOptions)
at CellsTest.Program.UnlockFile(String sInputFile, String sOutputFile, String sFilePassword, List`1 lstSheetPasswords) in D:\MyProjects\CellsTest\Program.cs:line 49
at CellsTest.Program.Main(String[] args) in D:\MyProjects\CellsTest\Program.cs:line 32
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:


Hi,

Thanks for your posting and using Aspose.Cells.

We have tested your issue with the latest version Aspose.Cells
for .NET v8.6.0.3
and found it is working fine.

Please download the latest version and try it at your end and let us know your feedback.

Thank you for your quick response. Yes it is working fine with version 8.6.0.3 and I no longer get a crash with the problematic test file.

Hi,


Good to know that latest version/fix figured out your issue now. Feel free to contact us any time if you need further help or have some other issue or queries, we will happy to assist you soon.

Thank you.

Hello,


Unfortunately there is still a problem with 8.6.0.3 for us. The problem is that it apparently cannot open XLS files where the password is 16 characters or more. In the process of sanitizing the problematic file we shortened the original password (which was over 16 characters long).

Attached is a sample VS2010 project where it fails to try to open a file where the password is “abcdef1234567890”. It works fine opening a file where the password is shortened by one character to “abcdef123456789”.

string sInputFile = @"…\calger_pw15.xls";
LoadOptions loadOptions = new LoadOptions();
loadOptions.Password = @“abcdef123456789”;
Workbook wb = new Workbook(sInputFile, loadOptions);
string sInputFile2 = @"…\calger_pw16.xls";
LoadOptions loadOptions2 = new LoadOptions();
loadOptions2.Password = @“abcdef1234567890”;
Workbook wb2 = new Workbook(sInputFile2, loadOptions2); // Crash

Thanks.

Hi,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue and logged this issue in our database for investigation and fix. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43960 - Cannot read some password protected file

Hi,


This is to update you that your issue is fixed now. We will soon provide you the fix after performing QA and including other enhancements and fixes.

Once, the fix is available for public use, we will share it with you here.

Thank you.

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells
for .NET v8.6.1.6
and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-43960) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.