Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Export to xls table
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01496017
Message ID:
01496036
Views:
58
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform