The value property of a range object in excel has the
ability to return an array of values. While it works fine
in VB or VBA, I cannot get the following code to work in
a vbs file.

Dim aryData()

Set oRange = oExcel.Range("A5").CurrentRegion
aryData = oRange.Value


I get the error
Microsoft VBScript runtime error: Type mismatch

Any thoughts?

Re: Excel, Value, and Arrays by Ray

Ray
Mon Sep 15 11:15:55 CDT 2003

Dim your aryData as a variant like:

Dim aryData

Ray at work

"Jason" <jcallas@lsplab.com> wrote in message
news:009601c37ba1$2ccfc1b0$a301280a@phx.gbl...
> The value property of a range object in excel has the
> ability to return an array of values. While it works fine
> in VB or VBA, I cannot get the following code to work in
> a vbs file.
>
> Dim aryData()
>
> Set oRange = oExcel.Range("A5").CurrentRegion
> aryData = oRange.Value
>
>
> I get the error
> Microsoft VBScript runtime error: Type mismatch
>
> Any thoughts?