Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Export data to excell file with formulas
Message
From
15/03/2002 05:35:11
Wilfred Chan
Bnp Paribas Hong Kong Branch
Hong Kong, Hong Kong
 
 
To
15/03/2002 04:56:14
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00633291
Message ID:
00633292
Views:
19
This message has been marked as the solution to the initial question of the thread.
>Hi all.
>Is it possible to export data to excell file setting
>in the same time formules needed for further use.
>Even better would be if it is possible to write in specific sheets/columns/raws
>of existing excell file without affecting already existing formules.
>Am I asking to much ?
>
>Any help is highly appreciated :-))

Hi
Yes, but it should be done manually.
e.g.
oexcel= CREATEOBJECT("Excel.Application")
obook = oexcel.workbooks.add()
oSheet= oBook.worksheets(1)

osheet.cells(1,1).value=1
osheet.cells(1,2).value=2
osheet.cells(1,3).FormulaR1C1 = "=RC[-2]+RC[-1]"

obook.saveas('c:\temp\test.xls')
obook.close

release obook
release oexcel

Of course, you can export it first, then open the Excel file and insert the formula and save it. It would be much faster if you export a lot of rows.

:) Wilfred
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform