Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

Compatibility below Excel 10.0 is difficult for there are no PIA's 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 don't 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 don't have a lot of ideas here... Although, you could try passing in the Range's directly (instead of Range.Value) and see if that works...

Posting Guidelines

 

Avatar by Lebb

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...