Use orders lcXLS = Sys(5)+Curdir()+'orders.xls' Copy To (lcXLS) Type Xls lcLastColumn = Chr(Asc('A')-1+Fcount()) && Last col not locked oExcel = Createobject('Excel.application') With oExcel .Workbooks.Open(lcXLS) With .ActiveWorkbook.ActiveSheet .UsedRange.Locked = .T. .Range(lcLastColumn+':'+lcLastColumn).Locked = .F. .Protect('mypassword') Endwith .Visible = .T. EndwithCetin