Nick_London
05-25-2009, 02:15 PM
Hi,
Previously on this site I was kindly helped by a couple of people to download a txt file from a website from within excel. The code is below and works fine.
Public Const FilePathX As String = "C:\"
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
URLDownloadToFile 0, "http://www.federalreserve.gov/releases/h6/hist/h6hist9.txt", FilePathX & "exampledata.txt", 0, 0
Does anyone know what the syntax should be to download a data file in excel format from the OECD website?
For example pasting the below line into web broswer takes you to data table that I want to download as an excel file from within excel.
http://stats.oecd.org/wbos/Index.aspx?datasetcode=MEI_CLI&lang=e
There is way export the data manually as a excel file (or csv) online by clicking on the export excel icon. But I'm struggling to work out what it should be if I want to go straight to the excel file.
Thanks,
Nick
Previously on this site I was kindly helped by a couple of people to download a txt file from a website from within excel. The code is below and works fine.
Public Const FilePathX As String = "C:\"
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
URLDownloadToFile 0, "http://www.federalreserve.gov/releases/h6/hist/h6hist9.txt", FilePathX & "exampledata.txt", 0, 0
Does anyone know what the syntax should be to download a data file in excel format from the OECD website?
For example pasting the below line into web broswer takes you to data table that I want to download as an excel file from within excel.
http://stats.oecd.org/wbos/Index.aspx?datasetcode=MEI_CLI&lang=e
There is way export the data manually as a excel file (or csv) online by clicking on the export excel icon. But I'm struggling to work out what it should be if I want to go straight to the excel file.
Thanks,
Nick