EXCEL and FWH

Ehab Samir Aziz
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Post by Ehab Samir Aziz »

Thanks Antonio your sample buildexcel is working I found the test word written to A1 cell.

May I write a function writecells() as below instead of the "test" even this done I found no exported method cells in writecells(nline,oSheet).

Code: Select all

   
OleSetProperty( OleGetProperty( oSheet, "Cells", nLine, 1 ), "Value", writecells(nline,oSheet) )
..

function writecells(nline,oSheet)
*-------------------------------
select 3
use mach
3->(DBGOTOP()) 
DO WHILE !(3)->(EOF()) 
oSheet:Cells( nLine, 1 ):Value = (3)->mc_serial
oSheet:Cells( nLine, 2 ):Value = (3)->mc_name
nLine:=nLine+1 
(3)->(DBSKIP(1)) 
ENDDO 
return nil
Ehab Samir Aziz
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Post by Ehab Samir Aziz »

Ok Thanks Antonio,
I got it . I put the following loop. It works.

Code: Select all


select 3
use mach
3->(DBGOTOP()) 
DO WHILE !(3)->(EOF())
OleSetProperty( OleGetProperty( oSheet, "Cells", nLine, 1 ), "Value", (3)->mc_type )
OleSetProperty( OleGetProperty( oSheet, "Cells", nLine, 2 ), "Value", (3)->mc_model )
OleSetProperty( OleGetProperty( oSheet, "Cells", nLine, 3 ), "Value", (3)->mc_serial )
OleSetProperty( OleGetProperty( oSheet, "Cells", nLine, 4 ), "Value", (3)->mc_brn ) 
nLine:=nLine+1 
(3)->(DBSKIP(1)) 
ENDDO 
Post Reply