>>Hi,
>>
>>I'm trying to freeze the top row in each worksheet in my workbook.
>>
>>I'm not quite clear on the use of "Window" in MS-Excel....every other command seems to work on a worksheet or workbook as a whole.
>>
>>I have tried setting the value to freeze the top row in a worksheet, etc. but the following is the only thing that i have gotten to work when m.tiSheet = 1; the workbook has 10 sheets in it.
>>
>>
>>WITH m.toWorkbook.WINDOWS[m.tiSheet]
>> .SplitColumn = 0
>> .SplitRow = 1
>> .FreezePanes = .T.
>>ENDWITH
>>
>>
>>Can anyone help w/the correct syntax to freeze the top row in EVERY worksheet in the workbook?
>>
>>TIA, appreciate it!
>>
>>J
>
>
>Jill, you can always determine the exact syntax of any sequence of commands in Excel by going in and beginning to record a macro, perform the operation, stop recording the macro, and then go in and view the macro source code. If there are any constants which show up as "xlValue" you can press F8 and then hover over them to obtain their actual values. Typically you can copy-and-paste into Visual FoxPro from there and with minor edits have it working.
Thanks Rick...that's EXACTLY what i did to get the syntax i used above. But I was getting messed up with the "Windows" reference (as opposed to workbooks and worksheets, etc.).
Just tried the following and it worked:
toWorkbook.Sheets[m.tiSheet].Select
WITH oAppInfo.oExcel.ActiveWindow
.SplitColumn = 0
.SplitRow = 1
.FreezePanes = .T.
ENDWITH
Thanks for responding. J