When we try to open the memory stream (that contains an excel sheet), we get error invalid password.
Tried printing the password and it looks correct and were able to open the excel book locally using that password. Are we using the api wrongly?
public Workbook LoadFile(MemoryStream mstream, LoadFormat flType, String password)
{
try
{
//Check if the file is valid.
if (mstream == null) { throw new ApplicationException(“Stream is null!”); }
LoadOptions options = new LoadOptions(flType);
if (!String.IsNullOrEmpty(password)) { options.Password = password; }
Workbook workbook = new Workbook(mstream, options);
return workbook;
}
catch (Aspose.Cells.CellsException ce) { throw TemplateException.TranslateException(ce); }
catch (ApplicationException aa) { throw TemplateException.TranslateException(aa); }
catch (Exception ee) { throw TemplateException.TranslateException(ee); }
}
Please provide us your problematic Excel file for our testing. Please also download and try the most recent version and see if it makes any difference and resolves your issue.
Please also provide us the password for the encrypted file, so we could evaluate your issue on our end.
Moreover, we recommend you to kindly install our latest verson/fix: Aspose.Cells for .NET v18.4 @ Nuget repos. and get your desired .NET framework compiled assembly (in the folder e.g “.\packages\Aspose.Cells.18.3.0\lib\net35” in your project) for your needs
After an initial test, I am able to observe the issue as you mentioned by using the following sample code with his template file. I found a different exception, i.e., “File is corrupted” when opening the encrypted Excel file:
e.g Sample code:
LoadOptions loadoptions = new LoadOptions(LoadFormat.Xlsx);
loadoptions.Password = "test";
Workbook workbook = new Workbook("e:\\test2\\test.xls", loadoptions);
I have logged a ticket with an id “CELLSNET-46081” for your issue. We will look into it soon.
Once we have an update on it, we will let you know here.
Yes, if it is not working in v16.11 but works in latest version/fix, then surely it was an issue in older version which was fixed in newer versions.
Regarding upgrade your subscription/licensing, please open your license file into notepad (please do not update anything in the license file least it will not work anymore) and check its subscription expiry date. If your subscription expiry date is greater than latest version’s (e.g v18.4.x) release date, then you may use it without any new license or upgrading your existing subscription. If it is less than it, then I am afraid, you have to upgrade your subscription. What is the expiry date of your subscription?
FYI, when you purchase a license for the product, you are authorized to use the license file with any new (and upcoming (official versions)) versions or hot fixes of the component for the next whole year. Moreover, your license will never expire if you continue to use your license with the product’s version/hotfix that should be released before your subscription expiry date.
It looks like your subscription is expired. Also, if you upgrade your subscription now, you can use any new/upcoming versions/fixes of the product for the next whole year for free.
We tried the latest version ASPOSE 18.4 and noticed a strange behavior.
we email excel sheet generated using aspose to our clients.
in our internal testing, 1) when we save the attachment and upload the xls file, it works fine. 2) when we open the xls file from the mail client (outlook 2011) and save, it prompts it is read only and we give a file name and save it to local disk.. When we upload this xls sheet, it complaints the file has corrupted.
So not sure what’s going wrong. Could you please investigate?
We are not sure about your issue. If 1) is fine then 2) should also be fine. I do not think the issue is with Aspose.Cells APIs. Anyways, if you still think it is an issue with Aspose.Cells, kindly do create a sample console application (runnable) using v18.4.x with all the steps involved, zip the project and provide us here (you may exclude Aspose.Cells assembly) to reproduce the issue on our end, we will check it soon.
This is use to protect your Excel file with password. In the following document, Excel file is password protected and it also explains how to specify encryption for protection.
We investigated further and the same code works ( ability to open the excel file with password) in
Windows 7 professional standard but not in Windows Server 2008 R2 Standard (service pack 1).
Is there any dependency on OS, culture info etc., ? Thanks.