


' Send the form data To URL As POST binary request ' You can uncoment Next line To see form results Set IE = CreateObject("InternetExplorer.Application") Sub VBAWebscrap() 'to refer to the running copy of Internet Explorer Dim ie As InternetExplorer 'to refer to the HTML document returned Dim html As HTMLDocument 'open Internet Explorer in memory, and go to website Set ie New InternetExplorer ie.Visible True ie.navigate https.
#Vba internet explorer document code
' 'Gets the browser to the url address and loops until thw website is completeky loaded The below code can be used to place the title of the Wikipedia article in cell ‘A1’ of the active worksheet. I have made some changes with your code, and I have tested on my machine, so you can refer to like below: Function Func_GetHTMLFile(URL As String, Optional StatusBarLoadMsg As Variant) As HTMLDocument 'Function to get the html file So I will suggest you confirming this issue on the VBA forum. Top 'Sets or gets the coordinate of the top edge of the object. Type 'Gets the user type name of the contained document object. Silent 'Sets or gets a value that indicates whether the object can display dialog boxes. This forum is for discussing about Excel for Developers, because your issue is about VBA that is outside the scope of this forum. Refresh 'Reloads the file that is currently displayed in the object. Any further idea to get my function working? So, your code may work but it does not meet my Jorge Barbi Martins I've already got a sub that makes it all for me, but I want to break it into two functions so it gets general and I may use it in multiple applications jut by giving it the right parameters. Step 2: Open Google home page by typing in the browser as Step 3: Right click on search text box and click on Inspect. Then Put a procedure name it Scrapping, you can choose name as per your wish. 'Create a new HTML document and set the current browser html to it, then turns off the Internet Explorer object Internet Explorer version 8 or higher (not Edge) Step 1: Insert a module and name it as modIEAutomation. 'Gets the browser to the url address and loops until thw website is completeky loadedĭo While ie.readyState READYSTATE_COMPLETE
#Vba internet explorer document how to
Is presented below, does anyone know how to get it running smooth? Function Func_GetHTMLFile(URL As String, Optional StatusBarLoadMsg As Variant) As HTMLDocument 'Function to get the html file I created a function to return the HTML document from a Internet Explorer and I can't seem to find a way to make it work the "Run-time error '91': Object variable or With block variable not set" always comes up.
