vba google spreadsheet httpGET, Authorization

Visto 57 veces
Saltar al primer mensaje no leído

persona...@gmail.com

no leída,
15 oct 2013, 9:22:3015/10/13
a excel-r...@googlegroups.com
Hello!

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

no leída,
15 oct 2013, 9:25:4215/10/13
a excel-r...@googlegroups.com
You need to use oAuth2 to authenticate to Google Spreadsheets


bruce



--
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.

persona...@gmail.com

no leída,
15 oct 2013, 9:39:0515/10/13
a excel-r...@googlegroups.com
thank your for your answer!!!  I will try .





вторник, 15 октября 2013 г., 16:25:42 UTC+3 пользователь bruce написал:
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos