运行下面的代码时,出现以下错误消息:
Sub login()
Application.DisplayAlerts = False
Dim url As String
url = UserForm.Path2.Value
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
With ie 'Open IE
.navigate url
ieBusy ie
.Visible = False
ie.navigate "https://mylink.com/ReporttypeID=1" 'Currently navigate to this set link
'Need IF statement to say if onclick = 1 then go to above link, else if it = 2 then go to the below link
'ie.navigate "https://mylink.com/ReporttypeID=2"
ieBusy ie
End With 'End IE actions
Application.DisplayAlerts = True
End Sub
代码在这里:
IndexError: list index out of range
任何反馈都会有很大帮助。非常感谢。