tags:

views:

225

answers:

1

I'm generating an excel spreadsheet using the PEAR extension, Spreadsheet_Excel_Writer. I need to add an array formula to one of the cells, but all the info I've read about them only discusses them as if you're in the Excel program itself: it says you have to type in the formula as normal and then press Ctrl+Shift+Enter to switch it to an array formula.

Is there a way I can do this programmatically?

+2  A: 

There is a property called FormulaArray that allows array formulas to be entered programmatically. Hopefully this is exposed to you from your PHP extension.

Usage:

Sheet1.Range("C1:C3").FormulaArray = "=(A1:A3)*(B1:B3)"
Lunatik
thanks - i'll investigate this and let you know how it goes.
nickf