[英]why I get a Run-time error 424 Object Required?
Sub ChooseTestWords()
Dim i As Integer
Dim s As Shape
Dim wordsArray1(1 To 3) As Variant
' Assign the 3 values in the sheet4 to the array
For i = 1 To 3
wordsArray1(i) = Sheet4.Cells(i + 1, 2).Value
Next i
Sheet1.Shapes("TestWordsBox").TextFrame2.TextRange.Text = wordsArray1(1).Value
End Sub
I get an 我得到一个
object Required Error 对象必填错误
at 在
Sheet1.Shapes("TestWordsBox").TextFrame2.TextRange.Text = wordsArray1(1).Value
May I know Why the error? 我可以知道为什么会出错吗? I'm simply assigning the value of the array to the text of the shape. 我只是将数组的值分配给形状的文本。
An array doesn't have a .Value
. 数组没有.Value
。 Change 更改
Sheet1.Shapes("TestWordsBox").TextFrame2.TextRange.Text = wordsArray1(1).Value
to 至
Sheet1.Shapes("TestWordsBox").TextFrame2.TextRange.Text = wordsArray1(1)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.