Error on getting the URL result of a Google search.

后端 未结 3 2030
轻奢々
轻奢々 2021-01-27 00:26

I am new to VBA, and I figured that trying to code is the best way to code. Anyway, I am trying to code a macro that will get first URL of a Google search result, but I\'m getti

3条回答
  •  忘了有多久
    2021-01-27 00:57

    One simple workaround--though not the best--is to skip the error.

    Try the following modification:

    start_time = Time
    Debug.Print "start_time:" & start_time
    
    On Error Resume Next '--Add this part.
    For i = 2 To lastRow
    

    Other options include a true error handling part, something that returns a value when your search returns nothing.

    Let us know if this helps.

提交回复
热议问题