Order of Operations

mlopes1

Board Regular
Joined
Jul 14, 2002
Messages
114
Is there a way to assure that an external data range is refreshed before any of the OnOpen events are performed.

I even tried manually refreshing in the on Open, and then calling the macros:

Private Sub Workbook_Open()
workbooks(1).RefreshAll
macro1 'call the macros
End Sub

But even this performs the macro operations, THEN refreshes, thereby making the macro useless.


Thanks as always,

Mark
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

mlopes1

Board Regular
Joined
Jul 14, 2002
Messages
114
I figured this out and thought I would share in case anyone runs across this.

Turning the external queries property to not "Background Refresh" forces the refreshing to be 100% completed before proceeding to the next line of code.

Simple, but it solved everything for me.
 

Forum statistics

Threads
1,182,136
Messages
5,933,852
Members
436,915
Latest member
Cygne volant

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