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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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.
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,618
Members
449,092
Latest member
amyap

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