Re: Error when using VBScript arrays
From: Chris Harrington (charringtonDEL_at_ETEactiveinterface.com)
Date: 04/04/04
- Next message: Ross Presser: "Re: PERL to VBScript help"
- Previous message: Roland Hall: "Re: Output to txt:"
- In reply to: Michael Harris \(MVP\): "Re: Error when using VBScript arrays"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 3 Apr 2004 23:43:12 -0500
Thanks Michael. I'll give that a try.
"Michael Harris (MVP)" <mikhar at mvps dot org> wrote in message
news:%236uOeKHGEHA.1240@TK2MSFTNGP10.phx.gbl...
> Chris Harrington wrote:
> > I am automating PowerPoint from WSF using VBScript. Everything is
> > fine, except when I try to call AddPolyline, passing an array of
> > points. I get the error "the specified value is out of range". I
> > assume that it is not getting the type of array it needs
> > (safearray?). Is there any way to handle this in VBScript? Also, I
> > get the same error if I try JScript.
> >
> > Someone suggested to do
> > triArray(0, 0) = CSng(25)
> > but that didn't change things.
> >
>
>
> The AddPolyline method (according to the docs) wants a 2D array of type
> Single. Script clients can only create arrays of variants. Even if the
> variant subtype is Single, it's not the same thing. A soultion is to
write
> a COM helper that could convert a 2D array of variant singles to a 2D
array
> of singles.
>
>
>
> >
> > ....
> >
> > Dim triArray(3,1)
> >
> > triArray(0, 0) = 25
> > triArray(0, 1) = 100
> > triArray(1, 0) = 100
> > triArray(1, 1) = 150
> > triArray(2, 0) = 150
> > triArray(2, 1) = 50
> > triArray(3, 0) = 25
> > triArray(3, 1) = 100
> >
> > slide1.AddPolyline triArray
> >
> > ....
>
> --
> Michael Harris
> Microsoft.MVP.Scripting
> Sammamish WA US
>
- Next message: Ross Presser: "Re: PERL to VBScript help"
- Previous message: Roland Hall: "Re: Output to txt:"
- In reply to: Michael Harris \(MVP\): "Re: Error when using VBScript arrays"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|