Free Support Forum - aspose.com

Not able to open workbook when protected via Aspose

Hi,

We are exploring Aspose for the product which we are building. During exploration I found that when we protect a structure of workbook, we were not able to open that workbook in the excel online!
Attached is the test program I used. When I upload the output of this program AsposeProtectedWorkbook.xlsb to sharepoint and try to open it asks me for password and when I enter password, it throws error that the password is wrong (The password I entered is correct and works when I open the same with desktop excel). Below is the screenshot of error. The thing is it shouldn’t even ask me for password, because I have only locked the structure of the workbook and not everything. Moreover, the workbook opens well in desktop excel. Can you please let me know if I am doing something wrong or is it a bug in Aspose?
The Program I used:
static void Main(string[] args)
{
Workbook wbk = new Workbook();
wbk.Protect(ProtectionType.Structure, “p”);

        wbk.Save(".\\" + "AsposeProtectedWorkbook.xlsb", SaveFormat.Xlsb);
        wbk.Dispose();
    }

Error:
Aspose.png (367.9 KB)

@srivardhan,

Please notice, I am able to reproduce the issue as you mentioned. I firstly created an output XLSB file (I protected the workbook regarding structure with a password in code) using the following sample code.
e.g.
Sample code:

Workbook wbk = new Workbook();
wbk.Protect(ProtectionType.Structure, "p");
wbk.Save("e:\\test2\\AsposeProtectedWorkbook.xlsb", SaveFormat.Xlsb);
wbk.Dispose();

I now manually created such a file in MS Excel 2016. I have two files (one is created by Aspose.Cells and other is created in MS Excel manually).

Now I used online office (365) using the url:
https://www.office.com/launch/excel?auth=1

I logged in via Microsoft (hotmail.com) account and used “Upload and open” option to open both files one by one. Here is complete details of the issue:

  1. The first opened the file (generated by Aspose.Cells) “AsposeProtectedWorkbook.xlsb” into it but it requires password to open (which it should not ask for). I even provided password “p” but it gives me wrong password error.
  2. When I opened the second file by MS Excel, it opens fine and does not ask for a password.

The first file “AsposeProtectedWorkbook.xlsb” also opens fine into MS Excel 2016 and does not ask for password.

I have logged a ticket with an id “CELLSNET-48135” for your issue. We will evaluate the issue if it requires something to be changed internally for workbook protection settings, so it should work seamlessly when opening the output file into online excel as well.

Once we have an update on it, we will let you know.

@Amjad_Sahi
Thanks… Any idea when this issue would be fixed? The reason I am asking is, if this issue is getting fixed in a couple of days, then we will continue our exploration of Aspose for our product…
Thank-you,
Sri

@srivardhan
Please try the latest fix 21.5.6.
Aspose.Cells21.5.6 For .Net2_AuthenticodeSigned.Zip (5.5 MB)
Aspose.Cells21.5.6 For .Net4.0.Zip (5.5 MB)
Aspose.Cells21.5.6 For .NetStandard20.Zip (5.5 MB)

Thanks… This worked… When will this version be released?

@srivardhan,
We are glad to know that your issue is resolved. This version will be released in the next week.