Error automating website data entry as the website is still loading

后端 未结 3 1820
悲&欢浪女
悲&欢浪女 2021-01-25 09:49

I have code which picks up data from multiple columns from ThisWorkbook and puts in various field in website in internet explorer. The website loads after clicking on <

3条回答
  •  醉梦人生
    2021-01-25 10:15

    revised on 2019-03-25

    I think the error is thrown because the doc is changed.

    Rewrite

    ' This is the Line2
        doc.getElementById("ContentPlaceHolder1_GridView1_chkboxSelectAll").Click
        'Wait 3 seconds till it selects all the checkboxes
        Application.Wait DateAdd("s", 3, Now)
    

    as

    ' This is the Line2 
        application.wait Application.Wait DateAdd("s", 1, Now)
        set doc = IE.document
        doc.getElementById("ContentPlaceHolder1_GridView1_chkboxSelectAll").Click
        'Wait 3 seconds till it selects all the checkboxes
        Application.Wait DateAdd("s", 3, Now)
    

    maybe helpful.

提交回复
热议问题