function CreateExcel() { document.all.OA1.CreateNew("Excel.Application"); var testNo = document.getElementById("<%=txttestno.ClientID %>"); var PlantCD = document.getElementById("<%=cmbPlant.ClientID %>"); var sExcelData = Modules_masters_TestMethodMaster_TestMethodMaster.ReExcelScreen(testNo.value, PlantCD.value); // Take excel date to database var objExcel = document.OA1.GetApplication(); var worksheet = objExcel.ActiveSheet; //Excel sheet var sdata = sExcelData.value; var aRow = sdata.split(',');//Data split for (i = 0; i < aRow.length; i++) { var aCol = aRow[i].split('#'); //Data split for (j = 0; j < aCol.length; j++) { var result = worksheet.cells(i + 1, j + 1).Formula = aCol[j + 1]; // Data fill in excel cell if (result != "") { //For check cell data for locking, here i want to protect or lock my cell data those are fill, they are not change in fill cell only change in blank cell worksheet.cells(i + 1, j + 1).Style.Locked = true; // this code is not work } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)