I'm relatively new to VBA but have been sucessful if generating a number of home use apps to save myslef time and effort going forward over my old excel only versions. My latest effort requires that I get some table data from the web for a given tide station point. This I was able to do and my code worked fine extracting the required table data. The online tide data defaults to the current month. I now want VBA to navigate forward one or more months and to the re-used the code I have working to get future month tide data. The site provides tide data for a given tide station ( Scarborough in my case) for the whole month. What I cannot get working in this new area to me is forcing the webpage to move forward one month. I've tried for over a day and failed. The month can manually on the site be pushed forward by working the month dialogue which is in middle of the top banner or alternatively with the "Tides for Scarborough" table that is displayed lower down. Eith works to do teh same and change the month of the tides table I then extract. My code so far as below but just returns a bad method error. My knowledge here is weak so I may well be missing something fundamental. Any pointers most welcome.
My code now as here ( which includes the site url)
My code now as here ( which includes the site url)
VBA Code:
Sub GetTideDatafromWeb()
Dim Ie As InternetExplorer
Dim WebPage As New HTMLDocument
Dim Tidetable As String
Set Ie = New InternetExplorer
Ie.Visible = True
Tidetable = "https://tides4fishing.com/uk/england/scarborough"
Ie.navigate Tidetable
Do Until Ie.readyState = READYSTATE_COMPLETE
Loop
Dim sSpanid As String
Set WebPage = Ie.document
sSpanid = "tabla_mareas_mes_mes"
Dim SpanMonth As MSHTML.IHTMLSpanElement
Dim tInput As HTMLInputElement
Set SpanMonth = WebPage.getElementById(sSpanid)
Debug.Print "Initial month shown = "; SpanMonth.innerText
WebPage.getElementById(sSpanid).Value = "April"
End Sub