AddPolyline always gives error

  • Thread starter Thread starter Glen Millar
  • Start date Start date
G

Glen Millar

Chris,

I don't know, but I know what you are going through! I was chasing help on
arrays this morning. If I find anything, I'll holler. I get an error every
time I click on the help area. :P~~~~~

--
Regards,

Glen Millar
Microsoft PPT MVP
http://www.powerpointworkbench.com/
Please tell us your ppt version, and get back to us here
Posted to news://msnews.microsoft.com
 
Hi,

I am creating a PPT slide with script. Adding other shapes works, but when
I add polylines I get the following error:

ERROR: -2147024809:The specified value is out of range.

The code to test adding a polyline is

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

.AddPolyline triArray
 
I am creating a PPT slide with script. Adding other
shapes works, but when
I add polylines I get the following error:

ERROR: -2147024809:The specified value is out of range.

The code to test adding a polyline is

Dim triArray(3,1)

Substitute:

Dim triArray(0 To 3, 0 to 1) as Single
 
He Steve,

I expect that would work, but I am using VBScript. Is there any way to do
this via script?

Chris
 
I expect that would work, but I am using VBScript. Is there any way to do
this via script?

Ah, and VBScript doesn't let you declare explicit variable types.
Good question. I've never used VBScript, but what you might do is get the code
snippet working within PPT then ask about it in one of the VBScript newsgroups
on this same server.

But here's a hunch to try out first:

Instead of:
triArray(0, 0) = 25

use
triArray(0, 0) = Csng(25)

Let us know if that works, 'kay?
 
Thanks Steve for the suggestion. I tried CSng and didn't have any change in
behavior.
I did as you suggested and posted to the VBScript group. Thanks again.
 
Thanks Steve for the suggestion. I tried CSng and didn't have any change in
behavior.
I did as you suggested and posted to the VBScript group. Thanks again.

No problem. Would you do me a favor and post back here when you find the
answer? Notice I said "when" and not "if"? Thought I'd send you on your way
with a nice optimistic boot. <g>
 
Back
Top