none
VBA help required to pull CSV file data RRS feed

  • Question

  • The bellow link  is put into a web browser that opens and pulls data into an excel file, I would to pull the data in excel using VBA with a 30minute refesh time pulling the latest data. no need to use a web browser

    https://my.wirelesstag.net/ethDownloadMultiStatsCSV.aspx?uuids=f66d7bfc-7898-47a8-90f3-f154460cf671&type=motion

    Thanks Steve

    Tuesday, March 14, 2017 7:54 AM

Answers

  • You can download this file and use import from text to cut informaction to seperate cells.

    If you want to use this by code you can it by the API "wininet.dll" or "urlmon.dll"

    Option Explicit
    
    Public Declare Function URLDownloadToFile Lib "urlmon" Alias _
       "URLDownloadToFileA" (ByVal pCaller As Long, _
       ByVal szURL As String, _
       ByVal szFileName As String, _
       ByVal dwReserved As Long, _
       ByVal lpfnCB As Long) As Long
    
    Sub GURoL(url As String, FileName As String)
    Dim lngRetVal As Long
        lngRetVal = URLDownloadToFile(0, url, FileName, 0, 0)
        If lngRetVal <> 0 Then
        MsgBox "No man, i cant do it. Fail download from " & url & " as " & FileName
        End If
    End Sub
    
    Sub download_https()
    Const url$ = "https://my.wirelesstag.net/ethDownloadMultiStatsCSV.aspx?uuids=f66d7bfc-7898-47a8-90f3-f154460cf671&type=motion"
    Call GURoL(url, "c:\your dest directory\file.csv")
    End Sub

    and then you can use import from local file.

    Then Menu/data/Text as column Easy to record that process.


    Oskar Shon, Office System MVP - www.VBATools.pl
    if Helpful; Answer when a problem solved

    • Marked as answer by Saltboy Tuesday, March 14, 2017 10:29 PM
    Tuesday, March 14, 2017 8:44 AM
    Answerer