I am very new to VBA and wrote this code. When I run it it gives me error 91. I tried fixing it by adding Set in front of a few variables but then the code wouldn't compile. Please help.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = Range("l:l").Column Then
Dim IE As New InternetExplorer
IE.Visible = False
IE.navigate "https://www.lloydslistintelligence.com/vessel/" & Target.Value & "/overview"
Do
DoEvents
Loop Until IE.readyState = READYSTATE_COMPLETE
Dim doc As HTMLDocument
Set doc = IE.document
Dim sDD As String
sDD = Trim(doc.getElementsByClassName("lli-dlist lli-dlist-shrink") (0).innerText)
IE.Quit
Target.Value = sDD
End If
End Sub