以下是我正在使用的代码:
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.Navigate "https:......"
Do Until .ReadyState = 4
DoEvents
Loop
.document.all.Item("sso_username").Value = "username"
.document.all.Item("ssopassword").Value = "password"
.document.forms(1).submit
End With
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https:...." , Destination:=Range("A2"))
.Name = "q?s=goog_2"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "1,2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
显示错误 .document.all.Item(“sso_username”)。Value =“username” 有谁能让我知道我错过了什么?