>>INKEY() is just for my test, so I can switch between VFP and Excel to watch what happens) you must remove it in production. FreezePanes freezes all rows above selected and all columns in left of selection (selection is not included).
>
>Does it prevent it from modifying? I probably used the wrong word. I need the column headers to be exactly the same. In other words, they should not be able to change them. How can I accomplish that?
O I see, you want to Lock the Cells, not to be showed if the user scrolls down.
To protect first row:
LOCAL oExcel AS Excel.Application
oExcel = CREATEOBJECT([Excel.Application])
oExcel.Workbooks.Add()
oExcel.Cells.Select
oExcel.Selection.Locked = .f.
oExcel.Rows("1:1").Select
oExcel.Selection.Locked = .t.
oExcel.ActiveWorkbook.ActiveSheet.Protect(,.t.,,.t.)
oExcel.Visible = .t.
INKEY(0)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.