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
-----------------------