Please find my 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
(As I want to handle this error with some other action so I need to know how can i show the error if nothing gets selected in the dropdown box)
'On Error GoTo Prob
MsgBox "Code has completed"
'Exit Sub
Prob:
MsgBox Err.Description & " has prevented the code completing"
End With
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
(As I want to handle this error with some other action so I need to know how can i show the error if nothing gets selected in the dropdown box)
'On Error GoTo Prob
MsgBox "Code has completed"
'Exit Sub
Prob:
MsgBox Err.Description & " has prevented the code completing"
End With