0

ここに私のコードがあります。空のドロップダウンリストを確認する必要がある場所にいくつかのコメントを入れました。


Dim IE As Object Application.DisplayAlerts = False
Dim chromePath As String

     Set IE = CreateObject("InternetExplorer.application")
     IE.Navigate "https://www.facebook.com/"      
     IE.Visible = True

Dim doc As Object

     IE.Top = 0
     IE.Left = 0
     IE.Width = 1200
     IE.Height = 1000
     IE.AddressBar = 0
     IE.StatusBar = 0
     IE.Toolbar = 0
     IE.Visible = True
     With IE
          Do
               If IE.ReadyState = 4 Then
                    IE.Visible = True
                    Exit Do
               Else
                    DoEvents
               End If
          Loop
          DoEvents
          Application.Wait Now + TimeValue("00:00:05")
          IE.Document.getElementById("month").selectedIndex = -2
          '(Here i want to check if the selected dropdown is blank as in case
          'of month on facebook I want to show some error and also want to do
          'some more action) 'On Error GoTo Prob MsgBox "Code has completed"
          'Exit Sub
          'Prob: MsgBox Err.Description & " has prevented the code completing"
     End With
4

1 に答える 1