Please see the following code. It iterates all the password list and tries to open the workbook one by one with each password. If the workbook is loaded successfully, it prints a message “Workbook loaded successfully” and if none of the password worked, then it prints a message "All passwords are wrong."
I have written another sample code for your reference for your needs. I have stored some passwords in an array list. The code will first check if the underlying file is encrypted and then trying loop through each password in the list to try to open the file by Aspose.Cells APIs. Once the password is matched and found, it opens the file successfully and exit the loop etc.
You are welcome, hopefully the code segments would help you to accomplish your tasks. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.
Thank you.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.