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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

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,147,518
Messages
5,741,634
Members
423,674
Latest member
Charles2dodo

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