Tag: internet explorer 11

Excel VBA填充IE导致在IE 11运行时错误,但不是9

我使用Excel工作簿中的数据创build了一个子项,以便在网站中填充表单域 该子在Internet Explorer中打开一个新窗口,导航到Intranet站点,并使用Excel工作簿中的数据填充表单域 本子使用Win7 Excel 2010和IE 9 当我使用较新版本的IE浏览器时,在Internet Explorer中打开一个新窗口并导航到Intranet站点,但无法填充表单字段,从VBA收到以下错误: 运行时错误“-2147417848(80010108)”: 自动化错误 被调用的对象已经与客户端断开连接 这是我的代码 Sub hOpenWsAndPopulate() Dim ie As Object Dim frm As Variant Dim element As Variant Set ie = CreateObject("InternetExplorer.Application") ie.navigate "www.mywebsite.com" While ie.readyState <> 4: DoEvents: Wend ' try to get form by ID Set frm = ie.document.getElementById("incidentTicket_Form") ' try to get form […]

Excel VBA更改表单中的下拉菜单

我尝试了一些替代scheme,但没有成功,改变combobox,你可以find下面的网站代码(它看起来问题是,combobox是在一个窗体 – 我不能改变一个input框): <form action="procRelLmPorData.asp" method="post" target="ifrmGerar" id="frmGerar" name="frmGerar"> <input type="hidden" name="ordem" id="ordem" value="" /> <table style="width:100%;" cellpadding="0" cellspacing="0"> <tr> <th class="header">Licenças Médicas por Data</th> </tr> </table> <table style="border-bottom:#048282 thin solid;width:100%;"> <tr> <td style="width:20%;vertical-align:top;"> <table> <tr> <td>Regional: </td> <td> <select style="width:200px" name="regional" id="regional" onchange="comboFilial(this.value);comboSetor('');"> <option value="">Selecione</option> <option value='67'>RJ</option> </select> 我已经尝试了下面的代码来解决它: 假设objie = InternetExplorer.Application 1st – […]

VBA代码 – 卡在第四循环

我有一个代码,应该打开一个网站,select一个位置,将HTML表格复制到Excel工作表,并在另一个位置重复。 但是当我尝试运行“For”循环时,在第四次迭代时出现错误。 消息说:“对象variables或块variables未设置”。 debugging工具指向44行 Sub ParseTable() Dim IE As InternetExplorer Dim htmldoc As MSHTML.HTMLDocument 'Document object Dim eleColtr As MSHTML.IHTMLElementCollection 'Element collection for tr tags Dim eleColtd As MSHTML.IHTMLElementCollection 'Element collection for td tags Dim eleRow As MSHTML.IHTMLElement 'Row elements Dim eleCol As MSHTML.IHTMLElement 'Column elements Dim ieURL As String 'URL Dim x As Integer […]

VBA IE11locking更改为下拉值

我正在使用VBA打开一个网站,login,然后导航到某个页面。 有8个选项的下拉菜单。 我使用这个代码来将下拉列表更改为我想要的值,但是当我继续时,它总是恢复为默认值。 如何locking此更改? Set Element = IE.Document.getElementsByName("date_range") Element.Item(0).Value = "custom" 这是页码: <div class="SelectInput"> <select class="SelectInput-select" name="date_range"> <option value="all_time">All Time</option> <option value="today">Today</option> <option value="yesterday">Yesterday</option> <option value="this_month">Month to date</option> <option value="last_month">Last Month</option> <option value="this_year">Year to date</option> <option value="last_year">Last year</option> <option value="custom">Between…</option> </select> <div class="SelectInput-arrows">…</div> </div> 谢谢,

在IE11中查找button(IUIAutomationElement)

我一直在试图使用下面的链接给出的代码,但我不能让它与IE 11的工作。 自动为IE9(vba)saveas dialouge 为了方便复制代码: Option Explicit Dim ie As InternetExplorer Dim h As LongPtr Private Declare PtrSafe Function FindWindowEx Lib "user32" _ Alias "FindWindowExA" (ByVal hWnd1 As LongPtr, _ ByVal hWnd2 As LongPtr, ByVal lpsz1 As String, _ ByVal lpsz2 As String) As LongPtr Sub Download() Dim o As IUIAutomation Dim e As IUIAutomationElement […]

VBA :自动化:在同一浏览器窗口/选项卡中打开链接

我想用VBA(Excel)parsing一长串本地网页( .HTM文件),并将一些数据提取到excel中。 有超过9000个程序需要刮的网页。 这是一个例子: > C:\Users\User_ID\Webpages\BS_1000.HTM.htm C:\Users\User_ID\Webpages\BS_1001.HTM.htm C:\Users\User_ID\Webpages\BS_1002.HTM.htm C:\Users\User_ID\Webpages\BS_1003.HTM.htm C:\Users\User_ID\Webpages\BS_1006.HTM.htm C:\Users\User_ID\Webpages\BS_1007.HTM.htm C:\Users\User_ID\Webpages\BS_1011.HTM.htm C:\Users\User_ID\Webpages\BS_1012.HTM.htm C:\Users\User_ID\Webpages\BS_1015.HTM.htm C:\Users\User_ID\Webpages\BS_1016.HTM.htm [… and the list goes on …] 这里是VBA: <!– language: lang-HTML –> For startNumber = 1 To TotalProfiles Dim ie As InternetExplorerMedium Set ie = New InternetExplorerMedium ie.Visible = True Application.StatusBar = "Loading profile " & ProfileNumber & " from […]

如何使用VBA在IE中自动下载对话框?

我在这里是全新的,只用了大约6个月的VBA。 毋庸置疑,这里和其他一些地方的论坛post对我来说是非常有帮助的。 我正在尝试开发一个脚本,从Morningstar获取数据并将其复制到excel中(请注意,这是为了我个人的非商业用途)。 我相信,我可以编写大部分所需的VBA,但是当IE下载对话框popup时,我自动select“保存”。 我已经看到了一些相关的post,但没有任何我已经能够反向工程,迄今为止,任何帮助将不胜感激! 目前为止我的代码如下: Sub Download_Morningstar_Data() ' ' Download Morningstar Data ' my_Page = "http://financials.morningstar.com/balance-sheet/bs.html?t=SCCO&region=usa&culture=en-US" Set IE = CreateObject("InternetExplorer.Application") With IE .Visible = True .Navigate my_Page Do Until .ReadyState = 4: DoEvents: Loop End With Application.EnableEvents = True IE.ExecWB 17, 0 Do Until IE.ReadyState = 4: DoEvents: Loop IE.ExecWB 12, 2 ' click […]

VBA填补webform

我正在做一些自动化,其中数据将在Excel中,并需要使用Excel值更新网站中的字段。 我发现这个macros在线,并试图编辑它,但它不工作。 请build议,所以我可以进一步进行字段更新一旦login成功。 我已经添加了以下的信息: Microsoft HTML对象库 微软互联网控制 问题:试图在IE8中运行它。 我需要更新到IE 11吗? 收到错误: 对象“IWebBrowser2”的方法“文档”在线失败 更改:我已经更新到IE11,现在错误更改为 “自动化错误,未指定的错误” IE.document.getelementsbyname("_58_login").Value = "jigarjigar" Public Declare PtrSafe Function SetForegroundWindow Lib "user32" (ByVal HWND As Long) As Long Sub Automate_IE_Enter_Data() 'This will load a webpage in IE Dim i As Long Dim URL As String Dim IE As Object Dim objElement As Object […]

IE自动化 – Excel VBA …加载网站后出现错误

我已经将VBA编程为与IE进行了相当广泛的交互,并且已经开始这样做了,但是我遇到了一个奇怪的现象,我无法用我所做的所有研究来解决这个问题。 只要我加载的网站,我失去了InternetExplorer Application所有参考,并不能再与对象工作。 当我检查站点被完全加载,我得到一个Run-Time Error 424 Object Required ,或Run-time error '-2147023179 (…)': Automation Error The interface is Unknown 如果我移动过这一行(同时看到站点完全加载)并运行Set doc …行,我得到Run-Time Error 462: The remote server machine does not exist or is unavailable 。 我正在使用IE 11和Excel 2010.我有Microsoft Internet控件和MicrosoftHTML对象库的VBAProject引用,但错误也发生在后期绑定以及。 Sub LoginToFXAll() Dim ieApp As InternetExplorer Set ieApp = New InternetExplorer With ieApp .Visible = True .Navigate […]