AddPolyline always gives error

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
 
C

Chris Harrington

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
 
S

Steve Rindsberg

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
 
C

Chris Harrington

He Steve,

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

Chris
 
S

Steve Rindsberg

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?
 
C

Chris Harrington

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.
 
S

Steve Rindsberg

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top