lcXLSName = sys(5)+curdir()+'customer.xls' Select * from customer into cursor myCursor Copy to (lcXLSName) type xls oExcel = createobject('Excel.Application') With oExcel .Workbooks.Open(lcXLSName) With .ActiveWorkBook.ActiveSheet .Cells(1,1).CurrentRegion.Locked = .F. && Set locked to .f. for all .Range('A:A').Locked = .T. && Lock first column .Protect('pw') && Enable protection with password pw Endwith .Visible = .T. EndwithCetin