Run-time error 1004 - file took too long to refresh?

CoconutP

New Member
Joined
Aug 11, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi, my VBA code opens a number of Excel files and refresh them, but some files take longer than others to refresh, and one or two of these files always causes this Run-time error 1004. Eventhough the attached image shows the error saying it couldn't get data from the external data source, I think the issue really has to do with the refresh going over VBA's tolerance limit and VBA just shuts down and give up. When I refreshed this same file manually, the file refreshed ok but took 3 minutes. Is there a way to insert a line in the code to force the code to give it more time to refresh the file?
 

Attachments

  • Run time Error 1004.PNG
    Run time Error 1004.PNG
    5.9 KB · Views: 2

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Anthony47

Well-known Member
Joined
Mar 29, 2006
Messages
2,267
If you know which files the workbooks you open fetch their updates from then you might open these files before starting the updating process, that will be much much faster

I don't know if (and how) you could modify the vba behaviour

Bye
 

Forum statistics

Threads
1,144,370
Messages
5,723,964
Members
422,529
Latest member
mbilal429

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
Top