hi everybody,
I am doing some matrix calculations in Excel / VBA. I am using the built-in Excel matrix functions MMULT, MINVERSE, TRANSPOSE etc, available via the Application.WorksheetFunction object. My code runs fine on Excel 2000 / 2003, however it stops with an error on Excel 97.

the code in question is (inside a "With Application.WorksheetFunction" of course)
-------
.MMult(.Transpose(x), x)
-------

where "x" is a Range of dimensions 3500*4 (rows*columns). If I try to run this in Excel 97, I get a "Type mismatch" error. I found out that if I use a range below size 1365*4 then it works fine, but as soon as my matrix has more than 1365 rows I get this error. I don't quite understand why I get a "Type mismatch" error and not an "Out of memory"-type error. And as I mentioned, the code runs on later versions of Excel.

Any idea how I could get it to run on Excel 97?

(Actually the code in question is
------
With Application.WorksheetFunction
b.Value = .MMult(.MInverse(.MMult(.Transpose(x), x)), .MMult(.Transpose(x), y))
End With
------
where x is a matrix of T*k, y is T*1 and b is k*1. Those of you familiar with statistics probably recognize that this is an ordinary least squares linear regression)

thanks a lot
Zsolt Tulassay