提醒:从Excel VBA
问题描述:
在Internet Explorer访问PHP对象我想要自动化的Excel上传过程中,我们必须为我们的数据仓库。从Excel VBA中,我启动一个IE会话到我们的数据仓库>用我的凭证登录>然后导航到要上传的页面,但这是我遇到问题的地方。提醒:从Excel VBA
浏览这个网站的时候,它在PHP中被编码的URL不会改变,我相信。因此,我需要点击具体图片 - 但我不知道如何。
在我的代码下面,我将自己的意见和调试时我收到错误消息。我还添加了网站图片,我尝试点击的按钮,并检查了元素。请提前帮忙,谢谢大家! < 3堆栈溢出!
签名,道鲜
Private Sub CommandButton2_Click()
Dim objIE As InternetExplorer
Dim aEle As HTMLLinkElement
Dim ele As Object
Dim y As Integer
Dim result As String
Set objIE = New InternetExplorer
objIE.Visible = True
objIE.navigate "http://kpionline.bitam.com/english/memberlogin.php"
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
objIE.document.getElementById("user_name").Value = "[email protected]" 'not real
objIE.document.getElementById("user_pwd").Value = "Bimbo2017" 'not real
objIE.document.getElementById("Login").Click
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
objIE.navigate "https://kpionline7.bitam.com/artus/genvi_test/LoadStage.php?txtRepositorio=fbm_bmd_0030&txtUser=xxxxxxx&txtPassword=xxxxx"
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
'**************************************************************************
'How do I click this icon???
objIE.document.getElementById("ENL8").getElementsByTagName("img")(0).Click
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
'Please see image for php/js website code
'ERROR: Run-time error '424': Object required
'**************************************************************************
objIE.Quit
End Sub
答
尝试objIE.document.getElementById("ENL8").Click
+0
相同的运行时错误msg .... :( –
您可以对应该点击图片就行了破发点?然后放置一个手表,除了'.Click'之外,看看它的范围是否正确。 – nbayly