We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Protection identification issues. Aspose.Cells 8.6.0.0

Description: Names of sample files (I refer to them in the list of issues) contains file format and protection info:
  • M - file has password to modify set.
  • O - file has password top open set.
  • OM - both passwords were set.
Issues
  • xlsm_M.xlsm, xlsm_OM.xlsm, xlsx_M.xlsm, xltm_M.xltm, xltm_OM.xltm, xltx_M.xltx, xltx_OM.xltx.
Workbook.Settings.IsWriteProtected returns wrong value. TRUE expected.
  • xls_OM.xls, xlt_OM.xlt.
FileFormatUtil.DetectFileFormat("").IsEncrypted returns wrong value. TRUE expected.
  • All O and OM files (but they have password to open set).
Workbook.Settings.IsProtected returns wrong value.

Sample code.

private static void TestExcel()
{
var di = new DirectoryInfo("");
var files = di.GetFiles("x*");
foreach (var f in files)
{
var d = new c.Workbook(f.FullName, new c.LoadOptions() { Password = "1" });
var IsEncrypted = c.FileFormatUtil.DetectFileFormat(f.FullName).IsEncrypted;
var IsProtected = d.Settings.IsProtected;
var IsWriteProtected = d.Settings.IsWriteProtected;
}
}

Hi,

Thanks for your posting and using Aspose.Cells.

We have tested this issue with your sample code by adding console statements using the latest version: Aspose.Cells
for .NET v8.6.0.2
and were able to observe this issue as mentioned by you.

We have logged this issue in our database for investigation. 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-43950 - Protection identification issues. Aspose.Cells 8.6.0.0

Below is the sample code and the console output for a reference.

C#
var di = new DirectoryInfo(@“F:\Shak-Data-RW\Downloads\o”);
var files = di.GetFiles(“x*”);
foreach (var f in files)
{
Console.WriteLine(f);

var d = new Workbook(f.FullName, new LoadOptions() { Password = “1” });

var IsEncrypted = FileFormatUtil.DetectFileFormat(f.FullName).IsEncrypted;
Console.WriteLine(IsEncrypted);

var IsProtected = d.Settings.IsProtected;
Console.WriteLine(IsProtected);

var IsWriteProtected = d.Settings.IsWriteProtected;
Console.WriteLine(IsWriteProtected);

Console.WriteLine("-----------------------");
}

Console Output:
xlsb_M.xlsb
False
False
True
-----------------------
xlsb_O.xlsb
True
False
False
-----------------------
xlsb_OM.xlsb
True
False
True
-----------------------
xlsm_M.xlsm
False
False
False
-----------------------
xlsm_O.xlsm
True
False
False
-----------------------
xlsm_OM.xlsm
True
False
False
-----------------------
xlsx_M.xlsx
False
False
False
-----------------------
xlsx_O.xlsx
True
False
False
-----------------------
xlsx_OM.xlsx
True
False
True
-----------------------
xls_M.xls
False
False
True
-----------------------
xls_O.xls
True
False
False
-----------------------
xls_OM.xls
False
False
True
-----------------------
xltm_M.xltm
False
False
False
-----------------------
xltm_O.xltm
True
False
False
-----------------------
xltm_OM.xltm
True
False
False
-----------------------
xltx_M.xltx
False
False
False
-----------------------
xltx_O.xltx
True
False
False
-----------------------
xltx_OM.xltx
True
False
False
-----------------------
xlt_M.xlt
False
False
True
-----------------------
xlt_O.xlt
True
False
False
-----------------------
xlt_OM.xlt
False
False
True
-----------------------

Hi,

Thanks for your using Aspose.Cells.

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

Hi,


Tested new DLL. Here are results in the order issues are mentioned in the initial post:
  • Settings.WriteProtection.IsWriteProtected returns correct value.
  • FileFormatUtil.DetectFileFormat(f.FullName).IsEncrypted returns correct value.
  • Workbook.Settings.IsProtected still returns wrong value (FALSE is always returned) for all formats and all combinations of passwords (O and OM).
Best regards,
Alex Shloma

Hi Alex,


Thank you for writing back.

I have evaluated the recently shared case against the latest version of Aspose.Cells for .NET 8.6.0.5, and I am able to notice that all of you provided samples (shared in first post) returns false for the WorkbookSettings.IsProtected property. I have reopened the previously logged ticket CELLSNET-43950 and have requested the product team to provide a justification for this behavior. As soon as we receive any updates in this regard, we will post here for your kind reference.

We are sorry for your inconvenience.

Hi,

Thanks for using Aspose.Cells.

WorkbookSettings.IsProtected is used check whether the structure or window of the Workbook is protected.

Please use WorkbookSettings.IsEncrypted to check whether the file is encrypted.

Thanks for an explanation.


Re tested. IsEncrypted works perfect on my set of test workbooks.

Best regards,
Alex Shloma

Hi,

Thanks for your feedback and using Aspose.Cells.

It is good to know that your issue is now sorted out. Let us know if you encounter any other issue, we will be glad to look into it and help you further.

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


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