+ Reply to Thread
Results 1 to 3 of 3

QueryTables.Add Not Working??

  1. #1
    Forum Contributor
    Join Date
    03-26-2015
    Location
    Cookeville, TN
    MS-Off Ver
    Excel 365
    Posts
    202

    QueryTables.Add Not Working??

    Help!
    I have a couple different spreadsheets that have macros that pull stock pricing and other data from (two different) Google Sheets files. A few days ago, BOTH stopped working. Nothing in the files or the macro code was changed. They worked one day, and then quit working the next (and ever since). Here is the critical code section:

    Please Login or Register  to view this content.
    If I manually enter the URL into a browser, it downloads the CSV file just fine. But when the macro code runs, it pastes NOTHING into the destination (as if the Sheets file were completely empty).
    If I manually download the CSV file, and manually paste the data into my Excel file, everything works fine.
    But when I run the macro, I get no data (and therefore, the macro bombs out later on since it expects at least one row of data to exist). The actual code section above runs and does NOT produce any error; it just doesn't paste in any data.

    What's going on? Is there another method I could use to download the file and paste the data into my Excel file, since apparently QueryTables.Add is not functioning properly?

    I should note that I publish one of these files online, and I have heard from at least one other user that they are also getting the same problem now, so it not limited to my own PC.

  2. #2
    Forum Contributor
    Join Date
    03-26-2015
    Location
    Cookeville, TN
    MS-Off Ver
    Excel 365
    Posts
    202

    Re: QueryTables.Add Not Working??

    No answers yet?

    Is there any way (other than QueryTables.Add) to open a CSV file from a website using VBA? If I could simply open the file, I could then use VBA to manually copy and paste the data into my file. I don't need to maintain a data connection; I just need a copy of the current data. Any help would be GREATLY appreciated!

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,945

    Re: QueryTables.Add Not Working??

    If you are using Excel 2010 or later (your profile indicates 2007), then you can get files employing Power Query (called Get & Transform in version 2016 and later). Look at the links in my signature.


    Also, here is a link to a function that I no longer use since I employ Power Query to get Stock Prices

    https://office-watch.com/2016/excel-...oogle-finance/
    Last edited by alansidman; 11-21-2020 at 01:54 PM.
    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

+ 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. QueryTables.Add
    By sparx in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2019, 12:21 PM
  2. VBA QueryTables
    By mrdomer07 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2019, 05:20 PM
  3. ActiveSheet.QueryTables.Add - only add 2nd row
    By umbata in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-03-2013, 12:45 PM
  4. Querytables.add issue
    By nerdzkilla in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-23-2012, 10:26 AM
  5. two querytables two worksheets
    By Kiethlard in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2010, 05:15 AM
  6. Querytables parameters
    By Dwaine Horton in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-27-2005, 12:06 PM
  7. [SOLVED] QueryTables Add
    By Marta in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-19-2005, 02:06 PM

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