Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE - Table to Excel file?
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00135005
Message ID:
00135062
Views:
10
>>Hi All,
>>
>>This is my 1st attempt at OLE Automation. I have a table from a x-tab query that I would like to transfer to an Excel worksheet for viewing, maybe even create a report with Text and company logo. I'm a little confused, do I use CREATEOBJECT('Excel.sheet') and export the data to the worksheet?? VFP help is a little vague in the matter.
>>
>>TIA
>
>select yourtable
>copy to c:\temp\test.xls type xls
>oExcel=createobject("Excel.Application")
>oExcel.Workbooks.open("c:\temp\test.xls")
>oExcel.visible=.t.

Thanks very much,

One question though. I'm trying to get the sum of each field to append as the last record in the table. Here's what i have:

select xtab
go bottom
append blank in xtab nomenu
for lnCnt = 2 to fCount() && 2nd field is the 1st numeric field
lcFieldName = field(lnCnt)
replace &lcFieldname with sum(lcFieldName)
endfor

should I add the table name lcFieldName = 'myTable.'+Field(lnCnt)??

TIAA
Perry E. Chrzanowski
Programmer/Analyst
Saturn (Solutions) Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform