使用VBA将网址发送到活动的IE窗口 [英] Using VBA to send url to an active IE window
问题描述
我正在VBA中工作,并在Excel中创建宏以将信息发送到IE浏览器窗口或从IE浏览器窗口发送信息. 我一直在使用AppActivate使用它的标题来专注于特定的IE页面,效果很好. 使用SendKeys将信息发送回浏览器还不是100%顺利,所以我现在开始使用...
I'm working in VBA and creating Macros in Excel to send info to and from an IE browser window. I've been using AppActivate to focus on the certain IE page using it's title which has worked fine. Using SendKeys to send information back to the browser hasn't 100% gone that well so I've now started using...
Set ie = New InternetExplorer
ie.Navigate "http://url"
'Loop until ie page is fully loaded
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
ie.Visible = True
后跟代码以填充Web表单上的各个字段.
followed by code to populate various fields on a web form.
除了当前已设置为打开新的浏览器窗口之外,这一切现在都非常有效. 我一直在尝试更改代码,以便找到与AppActivate类似的IE窗口.但是我找不到将两者结合的方法. 有人可以帮忙吗? 我该如何更改.....
This all works really well now except that it is currently set to open a new browser window. I've been trying to change the code so it finds the IE window I'm using similarly to AppActivate. But I can't find a way of combining the two. Can anyone help please? How do I change.....
Set ie = New InternetExplorer
到
Set ie = IE WINDOW WITH THIS TITLE.... or something similar?
非常感谢
保罗
推荐答案
请阅读此链接以通过其地址获取IE窗口
Please read this link in order to get an IE window by its address
http://vba-corner.livejournal.com/4623.html
这是另一个有用的链接
http://www.excely.com/excel-vba/ie- automation.shtml
希望是有帮助的
这篇关于使用VBA将网址发送到活动的IE窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!