title: vba for Internet explorer - How to show error message box when Dropdown selected for month is empty
body: <p>Here you have my code. I've put some remarks where I need to do check the empty dropdownlist.  </p>
  
  <pre><code>
  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
  </code></pre>