View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ExcelMonkey ExcelMonkey is offline
external usenet poster
 
Posts: 553
Default Run Time Error "13" Type Mismatch

Came across this note on the microsoft site:

http://support.microsoft.com/default...;en-us;Q177991

Suggesting that the error occurs because the function is contrained by the
65326 rows contraints in Excel. I find this confusing as I am always loading
the array from the same cell in Excel.

How do I use the Average, STD, Min, Max worksheet functions from Excel in
VBA if I have this following contraints given that my array will have well
over 65000 items?

Thanks

EM



"ExcelMonkey" wrote:

I am getting a Run Time Error '13' Type Mismatch Error on the following line
of code:

Var1 = Application.WorksheetFunction.Average(Array1)

The Array is filled with data from the cells in the spreadsheet while in a
For next loop. It populates the arrray after a Calculate. Whenever I
increase the loop 65,000 runs, I get the error on this line of code. The
Array is dimensioned as a Variant. Is a Type Mismatch of this kind occuring
becuase I am loading a spreadsheet error (i.e. DIV/0 etc) into the array and
the Average function fails? It does not seem to fail on runs less than
65000.

How can I check the contents of the array to see what would cause the
Average function to fail?

Thanks