Hi Everybody

I'm writing (yet another) poor man's data collection engine using kix, and MS Excel (for presentation). Unfortunately I have run into some difficulties with my dynamically generated excel worksheets.

My code is quite capable of creating, and entering data into an excel document, but when it comes to functions, I can't quite get it to work.

A simple function, like "countif" simply results in no data entering the target cell.

Any help would be greatly welcomed !!!

-
Jakob

CODE EXAMPLE (look at cell B10 & C10):
$OutputFile = "C:\Output.xls"

$app = CreateObject("Excel.Application")
$wbs = $app.Workbooks
$null = $wbs.Add
$worksheet1 = $wbs.Item(1).Worksheets.Item(1)

$worksheet1.Range(B2:B9).Formula = 'Jimmy'
$worksheet1.Range(C2:C9).Formula = '6'
$worksheet1.Range(B10).Formula = '=COUNTIF(B2:B9;"Jimmy")'
$worksheet1.Range(C10).Formula = '=SUM(B2:B9)'

$wbs.Item(1).SaveAs("$OutputFile")
$wbs.Close
$worksheet1 = 0
$worksheet2 = 0
$wbs = 0
$app = 0

RUN "CMD.EXE /C " + $OutputFile
_________________________
---ooo00ooo--- Jakob Bindslet