Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Export data to excell file with formulas
Message
De
15/03/2002 05:35:11
Wilfred Chan
Bnp Paribas Hong Kong Branch
Hong Kong, Hong Kong
 
 
À
15/03/2002 04:56:14
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00633291
Message ID:
00633292
Vues:
20
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform