none
VBA ADO connection excel using http RRS feed

  • Question

  • Hi

    I would like to open an ADO connection to an excel file. If the file path is a local address, or a network address, it works fine. If the address begins with "http", it doesn't work, the erros message is "Invalid internet address"

    My sample code:

    Dim oconn As Object
     
    Set oconn = CreateObject("ADODB.Connection")
     
     oconn.Provider = "Microsoft.ACE.OLEDB.12.0"
     oconn.properties("Extended Properties").Value = "Excel 8.0; HDR=YES"
     oconn.Open "Data Source = http://belvarbcs.hu/matematika/tehetsm/doc/Tutaj.xls;"


    Is it impossible or the solution is change a parameter in the code?

    Thanks

    Attila

    Tuesday, May 6, 2014 7:26 AM

Answers

  • The solution is: 

     oconn.Provider = "MS Remote"
     oconn.Properties("Extended Properties").Value = "Excel 8.0; HDR=YES"
     oconn.Open "Data Source = http://belvarbcs.hu/matematika/tehetsm/doc/Tutaj.xls"

    Tuesday, May 6, 2014 8:00 AM