+ Reply to Thread
Results 1 to 3 of 3

QueryTables bug. If one query fails, all subsequent queries will fail unless restart Excel

  1. #1
    Registered User
    Join Date
    06-27-2024
    Location
    San Jose, California
    MS-Off Ver
    MS Office 10, MS Office 21
    Posts
    2

    QueryTables bug. If one query fails, all subsequent queries will fail unless restart Excel

    I wrote a VBA code to download stock data from Yahoo Finance. To explain the bug that I discovered, I wrote the following VBA program. The VBA program downloads data for stock symbols SPY, XXX, and QQQ from the Yahoo Finance website and displays the downloaded data on sheet1. Because the stock symbol XXX does not exist, the QueryTables to download the data of Stock XXX will generate an error. I used "On Error Resume Next" to ignore the error and move to the next line of the program to download data for stock QQQ. For Excel 2010, if the query to download data of a stock fails because the Yahoo Finance web server does not have the data., the next downloads for other stocks can still work. But , for Excel 2019 and Excel 2021. maybe other Excel of newer versions too, if a query for a stock fails, all next queries for other stocks will fail unless I restart Excel. I tested the problem in Windows 10 and 11, and the results are the same. Do any people know why new versions of Excel have this problem while Excel 2010 does not? I would appreciate it if someone could help me to solve this problem.

    I need to download data for over a hundred stocks. Data for some stock symbols are sometimes missing in Yahoo Finance. Because of the bug, if the download for one stock ticker fails, I have to restart Excel and download the data from the beginning again.

    ************************************************************
    Please Login or Register  to view this content.
    Last edited by sheepmob; 06-27-2024 at 06:32 PM. Reason: Make Title clearer

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2407 Win 11 Home 64 Bit
    Posts
    24,081

    Re: QueryTables bug for Excel 2019 and Excel 2021, but Excel 2010 does not have the bug

    Administrative Note:

    We would very much like to help you with your query, however your post does not comply with our guidelines

    Please take a moment to review how to add code tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Guideline #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here.

    I have added the code tags for you today. Please take a few minutes to re-read our guidelines and rules that you agreed to when you joined and comply in the future.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-27-2024
    Location
    San Jose, California
    MS-Off Ver
    MS Office 10, MS Office 21
    Posts
    2

    Re: QueryTables bug for Excel 2019 and Excel 2021, but Excel 2010 does not have the bug

    ^

    Alansidman, thank you very much for your help. I am a new member and posted it for the first time, so I did not know the forum guidelines. Now I have learned.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Updating array formula from excel 2019 to use LET in excel 2021
    By Marvo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-31-2024, 09:47 AM
  2. Replies: 8
    Last Post: 12-05-2022, 08:38 PM
  3. Unable to configure Excel 2019 the way I used Excel 2010.
    By stlucia in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 10-10-2020, 05:42 PM
  4. Macro filter date works in Excel 2010 and not in 2019
    By Berna11 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2020, 07:11 PM
  5. [SOLVED] Excel 2019 workbook with slicer won't work in Excel 2010 - help please
    By Excel enthusiast in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-07-2019, 12:59 PM
  6. Replies: 0
    Last Post: 09-27-2019, 03:34 PM
  7. macro works in excel 2019 but not in 2010 this gives type mismatch error 13
    By Newbikonob1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2019, 06:25 AM

Tags for this Thread

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