无法开始下载

时间:2017-03-13 17:16:11

标签: html excel vba

我正在自动下载报告,但我很难让报告运行。手动执行流程时,我导航到报告区域并右键单击“以excel身份运行”

当我检查元素时,我有以下行,我无法在我的代码中运行。 Elements

我已经尝试过.click一些不同的ID(“ext-gen152”)或(“ext-gen153”),但我认为我需要处理不同的行,因为它不是一个可见的按钮但是一个隐藏的菜单。

如果这很简单并且在接受我的道歉之前已经被覆盖,那么正确的方向上的一个点就会被提交。 IE有一个非常好的资源vba吗?

我也试过循环遍历对象中的元素,但不知道“ext-gen152”所在的对象的名称

Sub AP_Login()

Dim Site As Object
Set Site = CreateObject("InternetExplorer.application")

Dim AP_ID As String
Dim AP_PW As String
Dim URL As String
Dim ControlSht As Worksheet
Dim Obj As Object

Site.Visible = True
Set ControlSht = Sheet2

AP_ID = ControlSht.Range("user").Value
AP_PW = ControlSht.Range("Password").Value
URL = ControlSht.Range("LogPage").Value

Site.Navigate URL
While Site.Busy
Wend

Dim oHTMLDoc As Object
Set oHTMLDoc = Site.Document

oHTMLDoc.getElementById("inputEmail").Value = AP_ID
oHTMLDoc.getElementById("inputPassword").Value = AP_PW
oHTMLDoc.getElementById("submit").Click

While Site.Busy
Wend

URL = ControlSht.Range("ReportPage").Value  

Site.Navigate URL
While Site.Busy
Wend


oHTMLDoc.getElementById("ext-gen153").Click



Site.Visible = True

End Sub

0 个答案:

没有答案