How to Unprotect Excel Sheet using Node.js

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

  1. Set the IDE to use Aspose.Cells for Node.js via Java to unlock a sheet
  2. The process is initiated by loading an Excel file having a protected sheet with a password
  3. Select the target sheet to be unprotected using the sheet index
  4. Call the Sheet.unprotect() by providing the password
  5. 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.

 English