返回列表 上一主題 發帖

[發問] 如何將從EXCEL內的資料貼入網站中(過程都由VBA自動執行)



我用以下的程式碼 出現以上圖的錯(之前不會有這問題) 另外奇怪的是 只要我是手動貼入 再手動點擊SUMBIT 網站都不會出錯呢 不知 如果改用FIREFOX 或GOOGLE的會好些?
有人能幫忙嗎?

Sub Test()
  Dim oIe, myData As DataObject, x
  
  Set myData = New DataObject  '需引用 MS Form Object Library
  
  With Sheets("自動計算表")
    .Range(.[A4], .[F4].End(xlDown)).Copy
  End With
  myData.GetFromClipboard
  
  Set oIe = CreateObject("internetExplorer.Application")
  With oIe
    '.Visible = False
    .navigate "http://www.evepraisal.com"
    Do While oIe.readystate <> 4: DoEvents: Loop
   
    .document.getElementById("raw_textarea").innerText = myData.GetText '填入
    .document.getElementById("result_submit").Click 'submit
   
    Application.Wait Now + TimeValue("00:00:05")  '等待5秒完成
   
       Set x = .document.getElementById("results").tFoot.all.tags("span")
    [L22].Value = x(0).innerText & " : " & x(3).innerText
    [L23].Value = x(1).innerText & " : " & x(4).innerText
    [L24].Value = x(2).innerText & " : " & x(5).innerText
    .Quit
  End With
  
End Sub

TOP

        靜思自在 : 一個缺口的杯子,如果換一個角度看它,它仍然是圓的。
返回列表 上一主題