General information
Category:
COM/DCOM and 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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only