Power Query Refresh gives old data

devmapall

New Member
Joined
Oct 6, 2020
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

I've searched around but can't find any instance where this problem has been solved. I've got some queries set up in Excel (2016) that get stock data for the day from a website. Typically I'll open the workbook and hit refresh all, and the data loads. Today, though, it's loading yesterday's numbers...but only sometimes. If I refresh individually, I can get about 4-5 queries to correctly update their numbers, but then it stops - it loads the old data after that, and same when I click "Refresh All". No error, no popup, it runs the query as per normal, it's just bringing in the wrong data. I thought it might be a problem with the website, but if that were true it seems like the individual refreshes wouldn't work either, but they do.

The weird thing is, after refreshing a few individually and getting the correct numbers, I clicked "Refresh All" and it actually overwrote the new data with the old - it switched it back! I am at a loss for why this could be happening or where to even start investigating.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I'm having a very similar issue, but with Excel querying local data saved in an Access table on my PC. My problems started happening sometime around April 16, 2021 as well (I don't know exactly when it started). For me: if I manually refresh the data, it updates properly. If I refresh the table in VBA (referencing the specific table), it brings in old data that no longer exists in the Access table. However, if I refresh the table in VBA (using RefreshAll), it updates the data properly. My problem is that I need to be able to update this Query specifically, without RefreshAll, through VBA - and I cannot current accomplish this.

Here's a summary of the testing I've done to try to resolve:
  • Refresh this table through VBA - ThisTable.Refresh (this was the existing code, which worked up until sometime around April 16) - NO LONGER WORKS - gets old data
  • Manually refreshing the table (clicking on the table, then clicking "Refresh") - WORKS, but I need to be able to refresh through VBA (as this is an automated report)
  • Refresh the table through RefreshAll in VBA - WORKS, but I need to be able to only refresh this table without refreshing other tables
  • Having a different user refresh the data through any Refresh function - WORKS, but I need this process to work on my login, as I have to manage the automated process

My current theory is that Excel is storing some kind of cached data somewhere on my PC... I can't find any confirmation of that, but I think this is what's happening, as the "old" changes on occasion to "newer" data that is still old and incorrect. And when other users test, they only get the correct data. I've tried clearing caches, but that does not resolve the problem.

Would love to hear any insight into getting this resolved.

Thanks!
 
Upvote 0
Still happening to me occasionally, like once every couple of weeks. One time, I tried to reset the permissions on my query - delete, refresh, then when it asks for my permissions I select "Anonymous" and it goes. It worked that time, but not tonight, when it is once again happening.

ANY ideas? I think ^^^ cfrehner has a good theory, that there's some stale cache somewhere that Excel is drawing from, but I've cleared the only cache I know about and this is still happening.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,520
Members
449,088
Latest member
RandomExceller01

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