Don't know what you are doing, but there were a few errors I corrected.
"Function" is misspelled
Using "Goto" is poor programming practice - generally leads to spaghetti code
In error handler use "Resume CleanUp"
Here are the changes I made to the code:
Code:
Function GetData(sName As String, sItem As String)
Dim oHttp As New MSXML2.XMLHTTP60
Dim xmlResp As MXSML2.DOMDocument60
Dim result As Variant
Dim sURL As String
On Error GoTo EH
'If sURL = "" Then
sURL = "http://api.eve-central.com/api/marketstat?typeid=" & sItem & "&usesystem=30000142"
'End If
'open the request and sent it
Debug.Print sURL & sName ' <<--- is this correct?? Should there be a comma or a space before sName???
oHttp.Open "GET", sURL & sName, False
oHttp.Send
'get the response as xml
Set xmlResp = oHttp.responseXML
'get Item
GetData = xmlResp.getElementsByTagName(sItem).Item(0).Text
'Examine output of these in the Immediate window
Debug.Print sName
Debug.Print xmlResp.XML
CleanUp:
On Error Resume Next
Set smlResp = Nothing
Set oHttp = Nothing
Exit Function
EH:
GetData = CVErr(xlErrValue)
'GoToCleanUp
Resume CleanUp
End Function