Disable Background Query results in Failing Download (PQ)

Niditro

New Member
Joined
Dec 17, 2019
Messages
7
Office Version
  1. 2016
Platform
  1. 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
 

Attachments

  • ErrorVBA.png
    ErrorVBA.png
    39.4 KB · Views: 65
When disabling Background Refresh, I receive below mentioned error message. With Background refresh enabled no issues....
 

Attachments

  • BackgroundRefreshIssue.png
    BackgroundRefreshIssue.png
    81 KB · Views: 33
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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