Excel 2010 yahoo historical stock query stopped working as of 5/9/17

wkrawdad

New Member
Joined
May 18, 2017
Messages
1
I have been using the following Excel 2010 VBA code daily in a number of programs to download historical stock data for many years until last week when stopped working (ERR 1004 - unable to open in line 20). I have searched the internet for many days to no avail regarding a change in the web address or other solutions. Many sites use the same vba code I am using or similar code, which I have tried.

Question: Does anyone know if this address has been modified by Yahoo as they did a number of years ago, or has this type of query been discontinued by Yahoo, either permanently or temporarily?
Question: Can anyone give me an example of a VBA query for Yahoo historical data downloads that currently works?
Thanks in advance for any help you can provide in pointing me in the right direction.


<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;"> qurl = "http://ichart.finance.yahoo.com/table.csv?s=" & Symbol
qurl
= qurl & "&a=" & Month(StartDate) - 1 & "&b=" & Day(StartDate) & _
"&c=" & Year(StartDate) & "&d=" & Month(EndDate) - 1 & "&e=" & _
Day
(EndDate) & "&f=" & Year(EndDate) & "&g=" & Range("E3") &
"&q=q&y=0&z=" & _
Symbol
& "&x=.csv"
DataSheet
.Range("H1") = qurl
On Error GoTo 90
QueryQuote
:
With DataSheet.QueryTables.Add(Connection:="URL;" & qurl,
Destination
:=DataSheet.Range("A2"))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
20 .Refresh BackgroundQuery:=False
.SaveData = True
End With</code>
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
From numerous inquiries on this Forum and others it appears Yahoo has changed it's format.

Don't know if permanent or temporary.
 
Upvote 0
Last edited:
Upvote 0

Forum statistics

Threads
1,224,847
Messages
6,181,325
Members
453,032
Latest member
Pauh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top