i´m not sure if this Technique is know : you can "paste" a Array into RANGE of a Excel Sheet
to build a Array from DBF is no Problem
than you need to "calculate" RANGE to fit Array Data
- Code: Select all Expand view
- cEnde := ZAHL2CHR( nColCount )
oSheet:range( "A1:" + cEnde+ + LTRIM( STR( nLen ) ) ) :value := aArray
as you can see it is easy and very quick
- Code: Select all Expand view
- FUNCTION ZAHL2CHR( nLFcount )
LOCAL nMal
LOCAL cEnde
IF nLFcount > 26
nMal := INT( nLFcount / 26 )
IF nMal = nLFcount / 26
cEnde := CHR( nMal + 64 - 1 ) + CHR( 90 )
ELSE
cEnde := CHR( nMal + 64 ) + CHR( ( nLFcount - ( nMal * 26 ) ) + 64 )
ENDIF
ELSE
cEnde := CHR( nLFcount + 64 )
ENDIF
RETURN cEnde