下拉菜单不点击以及如何将网页保存为pdf(pdfcreator,cutepdf writer)绕过saveas提示符vba

时间:2014-02-21 15:58:44

标签: excel vba pdf excel-vba

新手!我把这个值放入后,这个网站的下拉菜单没有点击或选择。我试过.click和.select并得到一个运行时错误'438':对象不支持这个属性或方法。是否有参考库连接到此呼叫?我目前必须将我的默认打印机设置为pdf writer并手动保存/命名pdf。有没有办法将网页保存为pdf(pdfcreator,cutepdf writer)绕过saveas提示符vba?

Private Sub CommandButton4_Click()


 Dim objIE

 Set objIE = CreateObject("InternetExplorer.Application")

 objIE.Navigate "http://treasurer.wincoil.us/TaxRecord.aspx?PIN=12-15-451-019"
 objIE.Visible = 1

 Do While objIE.ReadyState <> 4
 DoEvents

 Loop
            objIE.Document.getElementsByName("ddlYears")(0).Value = "2011"
             Application.Wait (Now + TimeValue("0:00:02"))

            objIE.Document.getElementsByName("ddlYears")(0).submit
           ' objIE.Document.getElementsByName("go")(0).Click

            Application.Wait (Now + TimeValue("0:00:02"))
 objIE.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER

 Application.Wait (Now + TimeValue("0:00:10"))
 objIE.Quit
End Sub

0 个答案:

没有答案