I have an Excel program which grabs historical stock prices from Yahoo. The program works fine in all cases except when I am trying to pull in a prices for the Dow Jones Industrial Average. The symbol that needs to be used for the Dow is "^DJI", which is the correct symbol. I was able to step through the code line-by-line and it appears to be grabbing the correct data from Yahoo. The issue is when the code comes to the line
pRecordSet.AddNew Array("Date", "Open", "High", "Low", "Close", "Volume", "Adj Close"), Array(RTFI(0), RTFI(1), RTFI(2), RTFI(3), RTFI(4), RTFI(5), RTFI(6))
For x = LBound(RTS) + 1 To UBound(RTS)
If RTS(x) <> "" Then
RTFI = Split(RTS(x), ",")
pRecordSet.AddNew Array("Date", "Open", "High", "Low", "Close", "Volume", "Adj Close"), Array(RTFI(0), RTFI(1), RTFI(2), RTFI(3), RTFI(4), RTFI(5), RTFI(6))
pRecordSet.Update
End If
Next x
Once it comes to this line of code, it immediately goes to the Err_CommandButton1_Click: section. I've stepped through the code now dozens of times and still can't figure out why it gets stuck for this symbol only. I'm hoping a fresh set of eyes might be able to see something I am missing. Any comments are appreciated. Copy Excel spreadsheet attached. Thanks
Bookmarks