Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert to excel book
Message
 
 
À
09/09/2005 11:08:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01048102
Message ID:
01048437
Vues:
18
Mohammed,

>thank you very much for reply ,a dvice , site and explaine
>
>not much data to push .

Here's some sample code.
create cursor curExcel ( i1 i, c1 c(10), t1 t )

insert into curExcel values ( 1, 'test 1', {^2005-09-10 01:23:45} )
insert into curExcel values ( 2, 'test 2', {^2005-01-01 13:45:01} )
insert into curExcel values ( 3, 'test 3', {^2005-12-31 23:59:59} )

loExcel = createobject( "excel.application" )
loExcel.Visible = .t.

loWorkbooks = loExcel.Workbooks
loWorkbooks.Add()
loWorkbook = loExcel.ActiveWorkbook
loSheet = loExcel.ActiveSheet

n = afields( laFields )
scan
   loRow = loSheet.Rows( recno() )
   for i = 1 to n
      loCol = loRow.Cells(,i)
      loCol.Value = evaluate( laFields[i,1] )
   endfor
endscan

loCol = .null.
loRow = .null.

loSheet = .null.
loWorkbooks = .null.

loWorkbook.Close( .t., "test.xls" )
loWorkbook = .null.

loExcel.Quit()
loExcel = .null.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform