Tag: internet explorer

如何在喜欢的combobox中使用vba在Internet Explorer中的值

我正在尝试使用VBA在网站上填写表单。 问题:问题是,在网页中,例如,如果我手动在第一个combobox中select一个值,则它会激活下一个combobox(否则会显示为灰色),从而链接combobox。 但是,当我尝试在下面的代码的最后一行中使用vba填充combobox中的值时,下一个combobox仍为灰色/非活动状态。 请帮忙。 Sub newabc() Dim ie As Object Set ie = CreateObject("internetexplorer.application") ie.Visible = True ie.navigate "URL" While ie.Busy DoEvents Wend ie.Document.getelementbyid("USER").Value = "username" ie.Document.getelementbyid("PASSWORD").Value = "password" ie.Document.all("Submit").Click While ie.Busy DoEvents Wend ie.navigate "tab" While ie.Busy DoEvents Wend ie.Document.all("new").Click While ie.Busy DoEvents Wend ie.Document.all("j_id0:frm:jobTrackerPageBlock0:startflds1:repeat5:1:inputField").Value = "Media Payables" 'problem occurs here as the next […]

在IE中打开一个文档,并能够将其作为variables存储在vbs中

我正在尝试编写一个vbs程序,在其中导航到一个网页,点击一个链接,在excel中打开一个文件,然后在excel文件中运行一个macros。 我知道如何导航到网页并点击链接。 我需要帮助搞清楚我如何存储Excel文件的方式,VBS程序可以操纵它。 Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_") IE.Visible = True IE.Navigate ("https://www.whateverWebsite.com/") Dim LinkHref LinkHref = "analyze" 'the key word that will be in the link to click Dim a For Each a In IE.Document.GetElementsByTagName("a") ' for every element whose tag name starts with 'a' for "a href" pull out its contents If InStr((a.GetAttribute("href")), […]

VBA在下载xls文件时省略从Internet Explorerpopup保存

我search了很多网站来获得答案,但无法成功。 我想从我的公司网站下载xls文件,并通过VBA我能够login,然后更改几个参数,最后我点击导出button。 点击导出button后,xls文件将被下载,但后来我得到了一个关于保存/另存为/打开从Internet Explorerpopup。 所以最后我卡在这里,我用发送键来下载这个,但有没有其他的选项,将保存xls文件在我定义的path和预先定义的xls名称。 还有一个问题,点击导出button后xls文件名可以是任何东西。 非常感谢您的帮助。

VBA IE点击button,需要参数?

我正在使用Excel和VBA编程。 我find了一个我想要点击的button。 但是,似乎这个button需要一个参数。 在Chrome中使用控制台,我input了这个: document.getElementById("button1").click 该行解决了function click() { [native code] }所以我试着这个: document.getElementById("button1").click ('100', '2016-03-02') 它的工作。 那么,我如何从VBA运行同样的东西呢? 我已经尝试了以下内容: Sub ClickTheButton() Dim IE As SHDocVw.InternetExplorer Dim Doc As MSHTML.HTMLDocument Set IE = New SHDocVw.InternetExplorer With IE .Visible = True .Navigate "(webpage here)" Do Until Not .Busy And .ReadyState = 4 DoEvents Loop Set Doc = .Document Doc.GetElementByID("button1").Click […]

从URL中检索数据

我已经广泛search,没有find我在找什么。 我对VBA的知识迄今为止仅限于操纵数字,所以这对我来说是一个新的领域。 我正试图从下面的链接LINK中拉出单行数据。 一旦完成,我可以parsing这些数据,但是我们会跨越那个桥… 以下是Excel VBA中的代码: Enum READYSTATE READYSTATE_UNINITIALIZED = 0 READYSTATE_LOADING = 1 READYSTATE_LOADED = 2 READYSTATE_INTERACTIVE = 3 READYSTATE_COMPLETE = 4 End Enum Sub ImportStackOverflowData() Dim ie As InternetExplorer Dim html As HTMLDocument Set ie = New InternetExplorer ie.Visible = False ie.navigate "http://api.rsbuddy.com/grandExchange?a=guidePrice&i=1637" Do While ie.READYSTATE <> READYSTATE_COMPLETE DoEvents Loop 'show text of […]

在错误不与IE自动化工作

我的代码是从一个网站获取信息,但在某些情况下,HTML代码与信息只是不存在,所以我使用On Error来处理它。 正如你将在代码中看到的,我正在遍历一个列表并获取每一行的信息(其中约700个)。 起初,错误发生在第10行,然后我添加了On Error GoTo 0 。 之后,它开始被扔在第13行。 我的configuration已经设置为断开Unhandeled错误 。 运行时错误号是: 91:对象variables或未设置块variables。 它发生在“** **” Sub GetData_DK() Dim IE As New InternetExplorer Dim URL As String Dim doc As HTMLDocument 'variable for document or data which need to be extracted out of webpage Dim onl As String Dim sto As String Dim pri As String […]

使用Excel VBA在Kendo UI小部件中select/操作项目

卡住了 – 需要帮助! 我正在尝试在我们内部公司网站的IE网页上自动执行操作项目。 我可以填写任何types的文本对象 ,点击提交button等,但有几个项目是在网格/表(Kendo网格)或下拉列表中。 我似乎无法弄清楚如何从这些网格/表格或下拉菜单中进行select。 我尝试了所有我能想到的,都无济于事。 我已经使用getElementById() , getElementsByTagName() , getElementsByName() ,甚至一些networking抓取技术。 不幸的是,由于网页在内部网站上,没有其他人能够对其进行testing。 这是我的代码的主要部分 'After opening the web page, inserting a number, selecting the "search" ' (all from the VBA script), I have to use a "mousemove", "mousedown" and ' "mouseup" to select the item, whick is what the "myClick" subroutine does myClick […]

为什么Sharepoint列表在导出到Excel时丢失了IssueID列?

我的团队目前使用Sharepoint列表来pipe理项目的错误,问题等。 我经常使用Sharepoint中的“导出到电子表格”function来pipe理Excel中的列表,在那里我可以进行编辑,更新和同步。 然而,我刚刚得到了一个shiny的新PC,现在每当我使用此function, IssueID列消失。 在我的旧电脑上,我得到以下内容: ABC ID ID Title ….. etc 1 246 foo 2 258 bar 3 266 foobar 其中列A将简单地是行号的索引,而列B是“真实的”IssueID。 在我的新电脑上,我得到以下 AB ID Title ….. etc 1 foo 2 bar 3 foobar 这意味着我不再拥有每个订单项的相应唯一ID – 坦率地说,这是无用的! 我的两台电脑都是Win XP,Excel 2003和IE6(我知道,但这是公司的政策),连接到同一个Sharepoint网站。 任何人都可以指出我可能会出错吗? 非常感谢, 安德鲁

vbs将文本从IE复制到Excel

任何人都可以帮助我一个简单的VBS脚本从该站点复制字段qwidget_lastsale到Excel表? http://www.nasdaq.com/symbol/abt/recommendations 我一直在尝试修改现有的脚本,但似乎无法使其工作。 我可以打开网站和excel,但不能复制该字段。 我想这之后有副本脚本: Set objExplorer = CreateObject("InternetExplorer.Application") WebSite = "http://www.nasdaq.com/symbol/abt/recommendations" with objExplorer .Navigate2 WebSite .left=5 .top=5 .height=1100 .width=700 .AddressBar = 0 .Visible = 1 .ToolBar = 0 .StatusBar = 1 WScript.Sleep 1000 Set objIE = Nothing end with Set xl = CreateObject("Excel.application") xl.Application.Workbooks.Open "C:\Users\user\Documents\testauto.xlsx" xl.Application.Visible = True 最好的问候user24

用VBA按网页上的button

我正在尝试使用VBA单击网页上的button。 该button位于<button>标记内,如下面的代码所示: <div class="search-options-container"> <button class="aui-item aui-button aui-button-subtle search-button" type="button" original-title="Search for Issues"> <span class="aui-icon aui-icon-small aui-iconfont-search">Search</span></button> </div> 我到目前为止使用的代码是: Dim ieApp As New SHDocVw.InternetExplorer Dim ieElement As Object Dim oHTML_Element As IHTMLElement … Do While ieApp.Busy And Not ieApp.readyState = READYSTATE_COMPLETE DoEvents Loop For Each oHTML_Element In ie.Document.getElementsByName("button") Debug.Print ("REACHED") If oHTML_Element.className = "aui-item aui-button […]