Page 1 of 1
Excel Help
Posted: Mon Aug 21, 2006 2:32 am
by cdmmaui
Hello,
Can someone provide the correct to set the following?
1) Freeze pane
2) Set Header
3) Set Footer
Thank you,
Posted: Mon Aug 21, 2006 2:43 am
by Carlos Sincuir
For freeze panel...using TExcelScript:
Code: Select all
/*
* TExcelScript():FreezePanel()
*/
METHOD FreezePanel( cRange ) CLASS TExcelScript
::oExcel:Range( cRange ):Select()
::oExcel:Application:ActiveWindow:FreezePanes := .T.
RETURN Self
Carlos Sincuir
Posted: Mon Aug 21, 2006 2:56 am
by cdmmaui
Hello,
I am using the following code and getting an error.
oAs := oExcel:ActiveSheet()
oAs:FreezePanes := .T.
Any ideas?
Thank you,
Posted: Mon Aug 21, 2006 6:43 am
by Detlef Hoefner
cdmmaui,
as Carlos pointed out, you have do do a "select" before.
The freeze command works like in real Excel.
First you have to select a cell and then you can freeze the sheet.
This sample works for me:
Code: Select all
oWin := oExcel:Get( "ActiveWindow" )
oSheet:Cells( 2, 1 ):Select()
oWin:Set( "FreezePanes", .t. )
Regards,
Detlef