What's new
HTML Forums | An HTML and CSS Coding Community

Welcome to HTMLForums; home of web development discussion! Please sign in or register your free account to get involved. Once registered you will be able to connect with other members, send and receive private messages, reply to topics and create your very own. Our registration process is hassle-free and takes no time at all!

HTML/VBA

mp3909

New member
I am new to HTML and I am trying to automate web scraping using VBA.
However, I am stuck.
I need to be able to set the current date to "20190528" but not sure how to access the HTML code i.e. I tried doing something like this in vba but I am not sure HTMLDoc.getElementById("ReportViewerControl_ctl04_ctl03_ddValue") is correct and if it is, do not know what to do after that to set the date to 20190528

Option Explicit
Sub BrowseToSite()

Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")

Dim HTMLDoc As MSHTML.HTMLDocument
Dim HTMLInput As MSHTML.IHTMLElement

IE.Visible = True
IE.navigate url

Do While IE.ReadyState <> 4
Loop

Set HTMLDoc = IE.document
Set HTMLInput = HTMLDoc.getElementById("ReportViewerControl_ctl04_ctl03_ddValue")

End Sub
 

Attachments

  • Capture.JPG
    Capture.JPG
    138.3 KB · Views: 1
Back
Top