I translated and added some parameters to this function from Delphi sources on the web.
Function supports 1D and 2D arrays.
All array's data are converted to String datatype.
This function doesn't depend on installed Microsoft Excel!!
_ArrayToXLS(Const ByRef $avArray, $sFileName[, $Transpose = False[, $iStartRow = 0[, $iEndRow = 0[, $iStartCol = 0[, $iEndCol = 0]]]]])
Here it is also with simple example: