Hi All,
I want to lock some of excel cells (not all) using X in my Export to Excel utility class.
When someone opens the excel file, they will be able to edit any cell except those cells. And if someone wishes to delete all editable data then read-only cells will retain their value and other editable cells will lose their value. Because the same file I have to use for import and these fields will used to identify unique values from AX.
For reference a part of code is attached below
using (var package = new OfficeOpenXml.ExcelPackage(memoryStream))
{
var currentRow = 10;
var worksheets = package.get_Workbook().get_Worksheets();
var worksheet = worksheets.Add("@ApplicationFoundation:DMFExportOperation");
var cells = worksheet.get_Cells();
//<---- Start---> Setup Header creation
//Want to make lock below field
cell=null;
value="XYZ";
cell=cells.get_Item(4,2);
cell.set_Value(value);
this.setCellBold(cell);
}
Thanks in Advance!!!
Regards,
Aimon Fatima