Hi i had written this code and it had worked originally but now im getting: Sub or function not defined
Sub PullSoftBalance()
Dim ie As New InternetExplorer
Dim doc As New HTMLDocument
Dim elem As Object
ie.Visible = True
ie.Navigate "BTIG"
Do
DoEvents
Loop Until ie.ReadyState = READYSTATE_COMPLETE
Set doc = ie.Document
Set elem = doc.getElementById("balance-after-impact")
If elem Is Nothing Then
MsgBox "No elements with the id 'balance-after-impact' were found on the website."
Else
Dim text As String
text = elem.innerText
Worksheet("soft schedule").Active.Range("B16").Value = text
MsgBox "Soft Balance has been updated from portal"
End If
End Sub
The underline section seem to be the issue
Sub PullSoftBalance()
Dim ie As New InternetExplorer
Dim doc As New HTMLDocument
Dim elem As Object
ie.Visible = True
ie.Navigate "BTIG"
Do
DoEvents
Loop Until ie.ReadyState = READYSTATE_COMPLETE
Set doc = ie.Document
Set elem = doc.getElementById("balance-after-impact")
If elem Is Nothing Then
MsgBox "No elements with the id 'balance-after-impact' were found on the website."
Else
Dim text As String
text = elem.innerText
Worksheet("soft schedule").Active.Range("B16").Value = text
MsgBox "Soft Balance has been updated from portal"
End If
End Sub
The underline section seem to be the issue