Excel version problems

pothuri

Active member
Joined
Nov 5, 2003
Messages
28
Location
Oklahoma
hi...

I am using excel object in my windows application and use the worksheetfunctions in my vb code. The statement below works fine when run using excel object 11.0 but when i program my application using excel object 9.0 the same statement gives an error saying type mismatch. I think in older version the Covar function has a problem in taking ranges as arguments.

dim cl1,cl2 as excel.range
dim oxl as excel.application

cl1=worksheet1.columns(i)
cl2 = worksheet1.Columns(j)

statsheet1.Cells(i, j).value = oXL.WorksheetFunction.Covar(cl1.Value, cl2.Value)

i would appreciate if anyone could help me figure this one out.

thnx
 
Compatibility below Excel 10.0 is difficult for there are no PIAs available and no official MSFT support. Somee have reported sucess automating down to Excel 97 (XL 8.0) by using Late Binding, which therefore implies that you have to use Option Strict Off.

As for this function, itself, I dont know. You are passing in Range.Value, so technically this is a 2D Array that you are passing in, so it should be fine. :( Sorry that I dont have a lot of ideas here... Although, you could try passing in the Ranges directly (instead of Range.Value) and see if that works...
 
Back
Top