on-internet
← Community

Copy data from HTML

Stack Overflow ·

I am trying to learn how to parse data from HTML using Excel VBA. So I found one example online which works fine but when I change URL address from www.yahoo.com to local HTML file on C it gives me error i.e. Method 'busy' of object 'IwebBrowser2' failed. Code is: Sub GetBodyText() Dim URL As String Dim Data As String URL = "file:///C:/test.html" Dim ie As Object Dim ieDoc As Object Set ie = CreateObject("InternetExplorer.Application") ie.navigate URL Do Until (ie.readyState = 4 And Not ie.Busy) DoEvents Loop Set ieDoc = ie.Document Data = ieDoc.body.innerText 'Split Data into separate lines '

Comments

Sign in or sign up to comment and upvote.

No comments yet.