Question: I'm rather new at scrubbing web pages, but am getting a hang of it. I've managed to successfully get data from a webpage with the follwing command:

```
sht.Range("b" & RowCount).Value = .document.getElementById("PriceLabel").getElementsByTagName("span")(3).innerText
sht.Range("c" & RowCount).Value = .document.getElementById("QuantityInput").Value

```

My challange is that not all webpages i search have these elements, and so the script stops with Run-time error 424 - Object required.

I've tried an On Error GoTo command, but that only works for the first incident, then stops on the second webpage with the missing elements.

That code is:

```
Next_sku:
Do
    RowCount = RowCount + 1
    SKU = sht.Range("a" & RowCount).Value

    With ie
    .Visible = False
    .navigate "http://www.staples.no/search?keywords=" & SKU

        Do While .Busy Or _
            .readyState <> 4
            DoEvents
        Loop

    sht.Range("b" & RowCount).Value = .document.getElementById("PriceLabel").getElementsByTagName("span")(3).innerText
    sht.Range("c" & RowCount).Value = .document.getElementById("QuantityInput").Value
    On Error GoTo Next_sku

    End With

Loop While sht.Range("a" & RowCount + 1).Value <> ""

```

Can anybody help me with a code that will either return a blank result, manual input such as f.eks "Does not exist" og simply skip ahead to the next command line if the element is noexistant. The most important thing is that the script doesn't stop.

Thanks :-)

Answer: 
I think the problem is that your code hasn't resumed from the first error. You can't check for an error within an error handler. By adding a resume statement to your code, VBA will no longer think you are inside the error handler and your code will resume as normal.

Here's an example:

```
On Error GoTo Next_sku
   sht.Range("b" & RowCount).Value = .document.getElementById("PriceLabel").getElementsByTagName("span")(3).innerText
   sht.Range("c" & RowCount).Value = .document.getElementById("QuantityInput").Value
Next_sku:
   'Do something on error
Resume Next

```

The above code will leave a blank result if the SKU is not found. You can add code after the `Next_sku:` label to return "Does not exist".

You could also try using `on error resume next` statement.
Many thanks to @Hubvill for finding an answer.

The code `On Error Resume Next`fixed this. My code now reads as follows:

```
Do
    RowCount = RowCount + 1
    SKU = sht.Range("a" & RowCount).Value

    With ie
    .Visible = False
    .navigate "http://www.staples.no/search?keywords=" & SKU

        Do While .Busy Or _
            .readyState <> 4
            DoEvents
        Loop

    sht.Range("b" & RowCount).Value = .document.getElementById("PriceLabel").getElementsByTagName("span")(3).innerText
    sht.Range("c" & RowCount).Value = .document.getElementById("QuantityInput").Value
    On Error Resume Next

    End With

Loop While sht.Range("a" & RowCount + 1).Value <> ""

```

The result is leaving the field blank, and continuing down the list og SKU's to lookup and grabbing data to them.

Excelent solution.