如何从Excel单元格中将数据输入到IE网页表单中

时间:2017-05-02 03:37:14

标签: html excel vba excel-vba internet-explorer

在此之前我做了很多搜索而没有成功。搜索链接至少包括此帖子底部的链接。请帮助。

有问题的网站是https://vcheck.ttc.lacounty.gov/proptax.php?page=main,您可以在击败CAPTCHA后点击相关的APN输入屏幕,然后点击"物业税查询/一次性付款"链接。然后您可以输入APN号码。

我能够将所有代码拼凑到网页上,但我没有尝试从我的Excel工作表中输入APN号码。代码如下。 1234567891只是一个例子,我真的希望它从Sheet 1和我选择的任何单元格中提取。我找到了代码来做这件事,但网页永远不会填充:(

Private Sub cmdAPNenter_Click()

Dim ie As SHDocVw.InternetExplorer

Set ie = New SHDocVw.InternetExplorer

ie.Visible = True

ie.Navigate "https://vcheck.ttc.lacounty.gov/proptax.php?page=main" 
'we are going to los angeles property tax page

Do

DoEvents

Loop Until ie.ReadyState = 4

'ie READYSTATE has 5 different status codes, here we are using status 4:

'Uninitialized = 0

'Loading = 1

'Loaded = 2

'Interactive = 3

'Complete = 4

Call ie.Document.GetElementByID("theform").SetAttribute("value", "1234567891")


Do

DoEvents

Loop Until ie.ReadyState = 3

Do

DoEvents

Loop Until ie.ReadyState = 4

End Sub

VBA to Enter Data Online and Submit Form How to copy data from a cell in Excel to a webpage text field? Input text into html input box using vba

0 个答案:

没有答案