vba google spreadsheet httpGET, Authorization

Skip to first unread message


Oct 15, 2013, 9:22:30 AM10/15/13
to excel-r...@googlegroups.com

First of all, i am sorry for my english. 
And thank your for cDataSet wb.

I have one qwestion and i so hope to help.

I do not understand why does not work when you try to login to import data from Google Spreadsheets (private access).

To get the data I use the function:

Public Function httpGET(fn As String, _
        Optional authUser As String = vbNullString, _
        Optional authPass As String = vbNullString, _
        Optional accept As String = vbNullString, _
        Optional timeout As Long = 0) As String
    pHtml = fn
    Dim oHttp As Object
    Set oHttp = CreateObject("MSXML2.ServerXMLHTTP")

    If timeout = 0 Then timeout = 30
    oHttp.SetTimeouts 0, 30 * 1000, 30 * 1000, timeout * 1000
    Call oHttp.Open("GET", pHtml, False)
    If (authUser <> vbNullString) Then

        oHttp.SetRequestHeader "Content-Type", "application/json"
        oHttp.SetRequestHeader "Accept", "application/json"
        oHttp.SetRequestHeader "Authorization", "Basic " + _
            Base64Encode(authUser + ":" + authPass)
    End If
    If accept <> vbNullString Then
        oHttp.SetRequestHeader "Accept", accept
    End If

    Call oHttp.Send("")
    httpGET = oHttp.ResponseText
    pStatus = oHttp.status
    Set oHttp = Nothing
End Function...

But if a table set access levels - the personal, the receive data using this function does not work. If access - public, then everything works fine.

Please help me unmasking

Bruce Mcpherson

Oct 15, 2013, 9:25:42 AM10/15/13
to excel-r...@googlegroups.com
You need to use oAuth2 to authenticate to Google Spreadsheets


You received this message because you are subscribed to the Google Groups "Excel Liberation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excel-ramblin...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Oct 15, 2013, 9:39:05 AM10/15/13
to excel-r...@googlegroups.com
thank your for your answer!!!  I will try .

вторник, 15 октября 2013 г., 16:25:42 UTC+3 пользователь bruce написал:
Reply all
Reply to author
0 new messages