确定IE中是否禁用HTML按钮

jua*_*kns 4 html excel internet-explorer vba excel-vba

我最近正在做一些VBA工作,如果启用我需要检查网页点击按钮,如果禁用则不要点击.

但!我不知道如何让VBA检查禁用按钮.

这是按钮代码:

<input name="formAction:proxima" title=">" disabled="disabled" class="button" id="FormAction:proxima" type="submite" value=">">
Run Code Online (Sandbox Code Playgroud)

我尝试了一些If,但没有奏效

    Set nxt = IE.document.getElementById("formAction:proxima")

    If nxt Is Nothing Then
        IE.Quit
    Else
        nxt.Click
    End If
Run Code Online (Sandbox Code Playgroud)

K.D*_*ᴠɪs 8

您还可以使用.disabled属性(布尔值).

Dim nxt As HTMLButtonElement
Set nxt = IE.document.getElementById("formAction:proxima")

If nxt.disabled Then
    ie.Quit
Else
    nxt.Click
End If
Run Code Online (Sandbox Code Playgroud)