3
我想在某种集合,arraylist,
中存储按钮,以便我可以动态添加和删除。vba形状集合
我试图使用集合,但似乎它不是选择,因为当达到ar.Add()时出现错误。
对象不支持此属性或方法。
Public Sub removeAllFormsWithAdd()
Dim myshape As Shape
Dim ar As Collection
For Each myshape In ActiveSheet.Shapes
If (myshape.FormControlType = xlButtonControl) Then
If (myshape.TextFrame.Characters.Text = "name") Then
ar.Add (myshape)
Debug.Print "next shape:" & myshape.TextFrame.Characters.Text & "-"
End If
End If
Next myshape
End Sub
我该如何得到它?
感谢您的帮助,现在它的工作。 – Gadolin 2010-10-23 12:59:12