If the workbook is protected with password, then you cannot load it inside the workbook object without providing the password. You will have to load it using the following code.
e.g
C#
LoadOptions opts = new LoadOptions();
opts.Password = “1234”;
Workbook workbook = new Workbook(“source.xlsx”, opts);
Once, you will have loaded it successfully, then Workbook.Settings.Password will contain a password.
Prem V V:
Also if there is any other ASPOSE option to check if the workbook/worksheet has a password or not ?
You can also detect if the file is encrypted with password or not without loading it actually. Please see this article for your reference.
Please note that FileFormatInfo class is present in Aspose.Cells namespace. You can opt to use the fully qualified name as “Aspose.Cells.FileFormatInfo”. In case you still couldn’t find the said class, this could be due to the reason that you are using any older version of the API, in which FileFormatInfo class hasn’t been added yet. In this case, we would suggest you to upgrade the API to later version.
Please feel free to write back in case you need our further assistance with Aspose.Cells API.
Well, as you are using .NET framework client profile version of the product in your project, so you might not use the latest version/fix: v7.7.1.4 for which I shared the link in my previous reply as this fix is compiled for normal .NET framework versions >= 2.0.
If you need .NET framework client profile version, kindly try to download our latest version (v7.7.1) from the Downloads module and get the required version from “\bin” folder at your installation directory:
Also, we do not ship any license for you with the fix archive. You may try the latest version v7.7.1 with your existing license. If your license is expired (you may open your license into notepad and check the subscription expiry date) to use the latest versions, I am afraid, you have to upgrade your subscription to use latest versions of the product, you may contact Sales in Aspose.Purchase forums.