Overview
I am using www.quandl.com free financial data to attempt to predict Asset price movements
Approach
I have built a function to download the data using the quandl API. I am declaring a windows API function located in urlmon.dll system 32 folder.
Code
Option Explicit
#If VBA7 Then
Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" ( _
ByVal pCaller As LongPtr, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As LongPtr, _
ByVal lpfnCB As LongPtr) As LongPtr
#Else
Private 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 LongPtr) As Long
#End If
Sub DownloadSingleFile()
Dim FileURL As String
Dim DestinationFile As String
FileURL = "https://www.quandl.com/api/v3/datasets/WIKI/FB/data.csv?"
DestinationFile = "C:\Users\hueve\Desktop\TheSystem\Fb.csv"
URLDownloadToFile 0, FileURL, DestinationFile, 0, 0
End Sub
Problem
This codes works, It will download the data to the correct file destination, I am wondering if there a way to instead of downloading straight to a file location; to just run it straight to an Access DB Table? I know the function explicitly states that it downloads straight to a file, but It would be nice to have a way to go straight to Access DB. Also I know next to nothing about these api function so please take it easy
Here is code with an array that pulls a single data point (52 week performance):