Solution
This error is generated when trying to write to a locked cell in a Excel sheet that is protected, you need to unprotect the Excel sheet in order to be able to write data to the cell. If the Excel sheet must be protected for security reasons, follow the steps below to unlock the cell or a region of cells.
1.- Un protect the Excel sheet temporarily by opening the Excel sheet, going to the Review tab, and clicking the Unprotect button. You may be asked for a password.
2.- Select the range of cells you wish to unlock (i.e. write data to even when the Excel sheet is protected).
3.- Right click the range of cells and click Format Cells...
4.- Select the Protection tab in the Format Cells dialog window.
5.- Uncheck the Locked checkbox.
6.- Go to the Review tab again to protect your Excel sheet.
You may now be able to write data to the unlocked cells in your Excel sheet.