- 帖子
- 117
- 主題
- 34
- 精華
- 0
- 積分
- 155
- 點名
- 0
- 作業系統
- windows XP
- 軟體版本
- OFFICE 2010
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2010-5-19
- 最後登錄
- 2025-11-17
|
怎麼接收網頁資料
在網路上找到這個
紅色是錄製加入的,怎麼可以登入網頁,但怎麼無法使用新增web查詢
需要怎麼修改?謝謝~
Sub macro1()
With CreateObject("InternetExplorer.Application")
.Visible = True
.navigate "http://www.cnyes.com/_mem_bin/FormsLogin.asp?http://www.cnyes.com/global/gl_idx.asp"
Do Until .Readystate = 4
DoEvents
Loop
.Document.f1.cn.Value = "id"
.Document.f1.UserPASSWORD.Value = "password"
.Document.f1.submit
End With
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.cnyes.com/global/gl_idx.asp?type=1", Destination:=Range("A1") _
)
.Name = "gl_idx.asp?type=1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With
End Sub |
|