> if m.tlLockHeaderRow && we need to prevent headers from modifying > ** Code from Borislav Borissov > loSheet.range(m.lcRange).select > loExcel.Selection.Locked = .t. >* loExcel.ActiveWorkbook.ActiveSheet.Protect(,.t.,,.t.) > endif>
if m.tlLockHeaderRow && we need to prevent headers from modifying ** Code from Borislav Borissov :-)))) I like this comment loSheet.range(m.lcRange).select loExcel.Selection.Locked = .f. && First we need to UNLOCK all cells oExcel.Rows("1:1").Select && Select First row of the sheet, If you want you could select only used cells loExcel.Selection.Locked = .t. && Lock Cells in first row loExcel.ActiveWorkbook.ActiveSheet.Protect(,.t.,,.t.) && Protect the sheet so Locked cells can't be edited endif