Hi there. I am using this to retieve HTML from a webpage
I have created another custom function (fromthewebpage) to extract info from the HTML and put it into an 2d array.
When I need the info in the sheet I recall it with =fromthewebpage(x,y) in a cell.
But the size of the array is 13*4 and I need the whole array and each use of the fromthewebpage(x,y) function call GetHTML independently, resulting in 52 retrievals of the page. Are there ways to only call GetHTML once and reuse that info for each use of fromthewebpage.
I imagine either 1) calling GetHTML when opening the workbook and storing the info in a persistent array that I can reference when using fromthewebpage or 2) making fromthewebpage an array function. But I don´t know if that is possible and how to do it.
Code:
Function GetHTML(url As String) As String With CreateObject("MSXML2.XMLHTTP")
.Open "GET", url, False
.Send
GetHTML = .ResponseText
End With
End Function
I have created another custom function (fromthewebpage) to extract info from the HTML and put it into an 2d array.
Code:
Function fromthewebpage(month,user)
....
....
....
fromthewebpage= udarray(month,user)
When I need the info in the sheet I recall it with =fromthewebpage(x,y) in a cell.
But the size of the array is 13*4 and I need the whole array and each use of the fromthewebpage(x,y) function call GetHTML independently, resulting in 52 retrievals of the page. Are there ways to only call GetHTML once and reuse that info for each use of fromthewebpage.
I imagine either 1) calling GetHTML when opening the workbook and storing the info in a persistent array that I can reference when using fromthewebpage or 2) making fromthewebpage an array function. But I don´t know if that is possible and how to do it.