This article describes how to unprotect Excel sheet using Node.js. It has all the details to set the environment, a list of steps to write the application, and a runnable sample code that demonstrates how to unlock Excel sheet using Node.js. This process does not require any third-party tool or software to perform this task.
Steps to Unprotect Excel Sheet using Node.js
- Set the IDE to use Aspose.Cells for Node.js via Java to unlock a sheet
- The process is initiated by loading an Excel file having a protected sheet with a password
- Select the target sheet to be unprotected using the sheet index
- Call the Sheet.unprotect() by providing the password
- Save the resultant Excel file
These steps summarize the process of how to unlock Excel sheet for editing using Node.js. The process is initiated by loading the workbook followed by accessing the target sheet that is locked using a password. In the final steps, the unprotect() method is called for the selected sheet by providing the existing password and saving the resultant workbook on the disk.
Code to Unprotect Sheet using Node.js
The aforementioned code demonstrates how to remove password from Excel sheet using Node.js. If there are multiple sheets that are locked using a password, you may iterate through all the sheets and provide the respective password for each sheet to unprotect it. You also may use the isProtected() method for every sheet to check whether it is protected or not before processing it.
This brief tutorial has taught us how to remove password protection from Excel using Node.js. If you want to apply filters in an Excel file, refer to the article on how to apply filter in Excel using Nodejs.