OLE XLS

OLE XLS

Postby Jack » Fri Feb 19, 2010 10:12 am

Hello,
When i protect a cell of a sheet and activate the protection, the cell is pretected but i can't change
the colors or size of other cells .

How to enable it ?

Thanks .


Here is the code :
oxls := TOleAuto():New("Excel.Application")
oxls:WorkBooks:Open("test.XLS")
oBook := oxls:Get( "ActiveWorkBook")
oSheet := oxls:Get( "ActiveSheet" )
oxls:Sheets("Actif"):select()
oxls:visible:=.T.

oSheet := oxls:Get( "ActiveSheet" )
oSheet:UnProtect("TEST")

oSheet:Range("A1","IV600"):Locked:=.F.
oSheet:Cells( 6, 2 ):Select()
oSheet:Cells( 6, 2 ):Font:Size := 7
oSheet:Cells( 6, 2 ):WrapText := .T.
wtxtp:="Something to be protected "
oSheet:Cells( 6, 2 ):Value:=wtxtp
oSheet:Cells( 6, 2 ):Locked := .T.
*
oSheet:Protect("TEST")
*
Jack
 
Posts: 280
Joined: Wed Jul 11, 2007 11:06 am

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 14 guests