|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
新疆地税的不能使用
经过小小的改动后不会出错了,但是只能把第一条数据自动填充到自动打开的网页中,仅限第一条
新疆地税也会出错
经过研读所给的代码,在进行小小的改动后可以使用了
改后的代码如下:- Private Sub CommandButton1_Click() '新疆国税查询
- Dim sends As String
- n = Range("a65536").End(xlUp).Row
- For p = 2 To n
- send1 = "zwcxxh=&fplb=1&fpdm=" & Cells(p, 1) & "&fphm=" & Cells(p, 2) & "&kpje=" & Cells(p, 3)
- With CreateObject("WinHttp.WinHttpRequest.5.1")
- .Open "GET", "http://www.xj-n-tax.gov.cn/zxbs/sscx/fpzwch/", False
- .send
- .Open "POST", "http://www.xj-n-tax.gov.cn:8001/sspt_web/pages/fpyw/fpywFpywcxAction.action?oper=QUERY", False
- .setRequestHeader "Referer", "http://www.xj-n-tax.gov.cn:8001/sspt_web/pages/fpyw/fpywFpywcxAction.action?oper=QUERY"
- .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
- .setRequestHeader "Connection", "Keep-Alive"
- .send send1
- tt = .responsetext
- With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
- .SetText tt
- End With
- If InStr(tt, "查询结果:") Then
- Cells(p, 4) = "该发票有问题,请手动核查!"
- Else
- Cells(p, 4) = Replace(Split(Split(Split(tt, "fpywFpywcxAction_xhfsh")(1), ">")(1), "<")(0), vbCrLf, "")
- Cells(p, 5) = Replace(Split(Split(Split(tt, "fpywFpywcxAction_xhfmc")(1), ">")(1), "<")(0), vbCrLf, "")
- Cells(p, 6) = Replace(Split(Split(Split(tt, "fpywFpywcxAction_hwmc")(1), ">")(1), "<")(0), vbCrLf, "")
- End If
- End With
- Next p
- End Sub
复制代码 office2007环境中运行最后的效果如下:
|
|