I’d like to protect a worksheet such that specific cells are writeable, but the user cannot copy/paste comments into those cells or change the formatting.
For every cell that I want the user to be able to write to, I am calling Cell.Unlock();
Then I call Worksheet.Protect(ProtectionType.All, “my password” null);
Overall it prevents editing most of the worksheet.
However, I am able to copy/paste from a cell in a different workbook/worksheet into the unlocked cells. When I paste, the formatting is overwritten and the comment is overwritten.
Is there any way to unlock a cell so that it can only be written to, but the formatting and the comments cannot be overwritten on that cell?
Side note - these example seem to all be empty (no .cs files):
Please manually create your Excel file using Microsoft Excel 2003 or 2016 etc. and provide it to us. We will look into your provided Excel file and create a replica of it using Aspose.Cells and provide you a sample code that will fulfill your requirements.
For .cs files, look into CSharp folder not Data folder. So the correct link is this.