Information générale
Catégorie:
COM/DCOM et OLE Automation
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement