Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Export to xls table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01496017
Message ID:
01496036
Vues:
59
>Hi
>
>I would like to export from .dbf to a xls table.
>However to the xls table is already formated and has named columns.
>
>Is there a way to recognize the xls columns to fill them, or
>do I have to rebuilt the whole .xls by command ?
>
>
>Moises

This may help:
* Suppose there is c:\yy.xls file where you want to append records starting at A20

SELECT * FROM your_table INTO ARRAY Array2Excel

oExcel=Createobject("Excel.Application") 
oExcel.Visible=.T.
oExcel.Workbooks.Open("c:\yy.xls")

StartCellAddress="A20"
EndCellAddress=oExcel.Range(StartCellAddress).Offset(ALEN(Array2Excel,1)-1,ALEN(Array2Excel,2)-1).Address
EndCellAddress=CHRTRAN(EndCellAddress,"$","")
oExcel.Range(StartCellAddress+":"+EndCellAddress).Value = ArrayPasser("Array2Excel") 

oExcel=null


RETURN
*--------------------------------------------
Procedure ArrayPasser 
Lparameters lcArrayName 
Return @&lcArrayName    && for VFP7 and above
Good Luck
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform