Results 1 to 8 of 8

Import Historical Stock Prices from Yahoo

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Import Historical Stock Prices from Yahoo

    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
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1