📌  相关文章
📜  vba 检查用户表单对象是否存在 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:57.994000             🧑  作者: Mango

代码示例1
Public Function WidgetExists(ByVal Name As String) As Boolean
    On Error Resume Next
        WidgetExists = Not Me.Controls(Name) Is Nothing
    On Error GoTo 0
End Function

Sub Test()
    MsgBox WidgetExists("Textbox" & 1)
End Sub