Excel Help

Post Reply
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Excel Help

Post by cdmmaui »

Hello,

Can someone provide the correct to set the following?

1) Freeze pane
2) Set Header
3) Set Footer

Thank you,
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Carlos Sincuir
Posts: 38
Joined: Mon Nov 28, 2005 2:10 pm

Post 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
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Post by cdmmaui »

Hello,

I am using the following code and getting an error.

oAs := oExcel:ActiveSheet()

oAs:FreezePanes := .T.

Any ideas?

Thank you,
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post 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
Post Reply