i have downloaded the google analytics api for statistica.... which is in Visual basic....
the following code is a part of the attached file. With break points i get an error on the last line "Set xmlNodeList1 = xmnNode1.childNodes". it goes to error.... and displays "type mismatch error 10080).
Can yousuggest why? i have windows 7 64bit system
Dim sURL As String
On Error GoTo ErrGetGAProfiles
If sAuthToken = "Authentication failed" Then
GetGAProfiles = "Authentication failed"
Exit Function
End If
sURL = "
https://www.google.com/analytics/feeds/accounts/default?max-results=10000"
Dim vObjhttp As Variant
Set vObjhttp = CreateObject("MSXML2.ServerXMLHTTP")
vObjhttp.Open "GET", sURL, False
vObjhttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
vObjhttp.setRequestHeader "Authorization", "GoogleLogin Auth=" & sAuthToken
vObjhttp.send ("")
Dim sGAResponse As String
sGAResponse = vObjhttp.responseText
If InStr(1, sGAResponse, "Token invalid") > 0 Or InStr(1, sGAResponse, "Authorization required") > 0 Then
GetGAProfiles = "Authentication failed"
Exit Function
End If
Dim xmDoc As MSXML2.DOMDocument
Dim xmnNode1 As MSXML2.IXMLDOMNode
Dim xmnNode2 As MSXML2.IXMLDOMNode
Dim xmlNodeList1 As MSXML2.IXMLDOMNodeList
Dim xmnNode3 As MSXML2.IXMLDOMNode
Dim xmlNodeList2 As MSXML2.IXMLDOMNodeList
Dim xmmNamedMap As MSXML2.IXMLDOMNamedNodeMap
Dim vTempArray() As Variant
Set xmDoc = New MSXML2.DOMDocument
xmDoc.loadXML (vObjhttp.responseText)
Set xmnNode1 = xmDoc.documentElement
Set xmlNodeList1 = xmnNode1.childNodes