Troubleshooting my Yahoo Finance Spreadsheet (with VBA)

captainxcel

New Member
Joined
Jul 28, 2017
Messages
35
Office Version
  1. 2016
Platform
  1. Windows
Thanks in advance to anyone who can help ...

For a couple of years I've had a working macro to pull historical stock data from Yahoo finance into a sheet in Excel starting at cell A1. Recently it stopped working! Though the if pasted into a browser will deli...&interval=1d&events=history&crumb=k3gEejzEY5Q

Public Sub Load_Yahoo()

Dim symbol As Variant, Qurl As Variant, startDate As Date, endDate As Date, interval As String, crumb As String
On Error Resume Next

symbol = [ticker]
startDate = [Start_Date]
endDate = [End_Date]
' endDate = CDate(Format(Date, "yyyy-mm-dd")) ' or endDate == today
interval = Trim([your_interval])
crumb = Trim([your_crumb])

Qurl = "https://query1.finance.yahoo.com/v7/finance/download/" & symbol _
& "?period1=" & (startDate - DateSerial(1970, 1, 1)) * 86400 _
& "&period2=" & (endDate - DateSerial(1970, 1, 1)) * 86400 _
& "&interval=" & interval & "&events=history&crumb=" & crumb

= Qurl With Sheets("Historical...uery:=False End With End Sub
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
.
Yahoo is known to periodically change their parameters / settings on their Finance pages. This has caused numerous issues for plenty of people
in recent years. Might want to start with YAHOO first because it may not be your macro.
 
Upvote 0

Forum statistics

Threads
1,215,945
Messages
6,127,851
Members
449,411
Latest member
adunn_23

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