Niditro
New Member
- Joined
- Dec 17, 2019
- Messages
- 7
- Office Version
- 2016
- Platform
- Windows
Hi, I have an issue with some given VBA code that refreshes the PQ connection to an Access query, but first sets BackgroundQuery to False, in order to be able to wait for the connection to be refreshed and then continues the code.
However, when background refreshing is turned on, the query runs fine and data is loaded to the worksheet, but when I turn off the background refresh, the query mentiones: "Download Failed".
When I run the code manually and keep pressing F5 on error, then in the end (after three error messages) it has downloaded the data. But when I add "On Error Resume Next" the it doesn't download the data. So it looks as if the error message is a bug, because when forcing the code to continue in the end the data is refreshed. Is there a way to simulate the "Debug - F5" combination in VBA, since "On Error Resume Next" is not working.
Also when I manually disable background query and click Refresh All then I get the same error.
I searched whole internet for similar issues and tried many tips and tricks but it still isn't solved.
Please find attached print screens too.
Hope someone can help me out here!?
Best Regards, Nico
However, when background refreshing is turned on, the query runs fine and data is loaded to the worksheet, but when I turn off the background refresh, the query mentiones: "Download Failed".
When I run the code manually and keep pressing F5 on error, then in the end (after three error messages) it has downloaded the data. But when I add "On Error Resume Next" the it doesn't download the data. So it looks as if the error message is a bug, because when forcing the code to continue in the end the data is refreshed. Is there a way to simulate the "Debug - F5" combination in VBA, since "On Error Resume Next" is not working.
Also when I manually disable background query and click Refresh All then I get the same error.
I searched whole internet for similar issues and tried many tips and tricks but it still isn't solved.
Please find attached print screens too.
Hope someone can help me out here!?
Best Regards, Nico