本帖最后由 bcrun 于 2010-12-10 10:58:14 编辑

解决方案 »

  1.   

    If a.Value = "1986" Or a.Value = "3" or a.Value = "6" Then a.Selected = True
    是不是要改为
    If a.Value = "1986" and a.Value = "3" and a.Value = "6" Then a.Selected = True
      

  2.   

    and 我试了,也是一样,不好使,还有就是
    调试这块,显示WebBrowser1.Document.getElementsByTagName("select")(3).appendChild (oOption)这句 “对象变量,或with变量未设置”
      

  3.   

    If a.Value = "1986" Or a.Value = "3" Or a.Value = "7" Then a.Selected = True
          改成If a.Value = "1986" and a.Value = "3" and a.Value = "6" Then a.Selected = True
    也不行
    那个测试未定义的,我整好了,差在这了
      

  4.   

    是不是这样?
    If a.Value = 1986 and a.Value = 3 and a.Value = 6 Then a.Selected = True
      

  5.   

    If a.Caption = "1986" or a.Caption = "3" or a.Caption = "6" Then a.Selected = True
      

  6.   

    以上两种都不好使,
    If a.Value = "1986" Or a.Value = "3" Or a.Value = "7" Then a.Selected = True
    这段,年可以填写,3月也可以填写,就是7,填不进去,不显示
      

  7.   

    我测试了一下主页,必须要点选一下某月,日期才能出来,如果自动填表,自动填写了,没有点击某月的下拉按键或直接点击月份选择框,日期是不会出现的,
    那么应该是从月份开始点击下拉按键,直接点这个选择框也行,选择月,或先选择月,再点击也行,然后才填入日期,这样就可以了如 
    If a.Value = "1986" Then a.Selected = True‘填写年
     If a.Value = "7" Then a.Selected = True,填写月
    然后,点击一下月份的下拉选择框 ComboBox1(vb的用法,网页是什么就不知道了)
    If a.Value = "3" Then a.Selected = True,日
    应该是这样,不过该怎么写呢
      

  8.   

    去掉括号试试WebBrowser1.Document.getElementsByTagName("select")(3).appendChild oOption
      

  9.   

    去掉括号也不好使
    我这么做的,可以激活第三个日期的选择框
    For Each a In WebBrowser1.Document.getElementsByTagName("OPTION")
             If a.Value = "1986" Then a.Selected = True
             SendKeys "{DOWN}"
             SendKeys "{TAB}"
             If a.Value = "7" Then a.Selected = True
             If a.Value = "2" Then a.Selected = True
          Next
    但是老没完没了的循环,一直到年份的选择框的年份循环完,怎么能让他不循环呢