fileformat-free-consulting / projects

1 stars 1 forks source link

I want to open a password protected .xlsx file and save it without a password #4

Closed molenich closed 2 years ago

molenich commented 2 years ago

Please check if it satisfies the following requirements:

If your requirement is actually a bug in our APIs or a feature request for our APIs then please use our forum to report it and get quick help: https://forum.groupdocs.com/

If all the above requirements are satisfied then please move on:

< describe your free consulting project requirements briefly>

< which platform you're working on -- operating system, development environment etc.>

amjad-sahi commented 2 years ago

@molenich ,

See the following C#.NET sample code for your needs. I use Aspose.Cells APIs to accomplish the task. The code snippets opens an encrypted XLSX file (here you got to specify the correct password), then removes the password before re-saving the file. When you open the output XLSX file, MS Excel won't prompt for password as the file would not be protected/encrypted anymore. e.g. Sample code:

string password = "abcd";
Aspose.Cells.LoadOptions loadOptions = new Aspose.Cells.LoadOptions();
loadOptions.Password = password;
var wb = new Aspose.Cells.Workbook("e:\\test2\\PasswordProtected_file1.xlsx", loadOptions);
wb.Settings.Password = null;//remove the password.
wb.Save("e:\\test2\\out1.xlsx"); 

Should you have further queries or issue, we encourage you to post in the dedicated forums.