发布这个回答你自己的问题是因为我看到很多帖子都有相同的错误消息,每个帖子都是独一无二的。
Sub makeCurve()
Const numpts = 7
Dim pts(1 To numpts, 1 To 2 )
For i = 1 to numpts
pts(i, 1) = 10 + i * 72 / 2
pts(i, 2) = 10 + i * 72 / 2
Next
Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes.AddCurve(pts).Line
.ForeColor.RGB = RGB(0, 0, 0)
.Weight = 1.5
End With
End Sub
尝试运行子程序时会给出以下信息:
Run-time error '-2147024809 (80070057)':
The specified parameter has an incorrect data type
如何解决错误?
Dim pts(1 To numpts, 1 To 2)
必须更改为
Dim pts(1 To numpts, 1 To 2) As Single