MichiZH
MichiZH

Reputation: 5817

Refresh data sources and workbook_open event

I have some procedures which should be executed with up to date data when opening a certain workbook. I've found out however, that the external data sources get updated only after the workbook open event took place. How can I change that? Or what could I do in order that these procedures get automatically run only after the external data sources have been updated?

Upvotes: 0

Views: 842

Answers (1)

user2140173
user2140173

Reputation:

You open your workbook and the Workbook_Open() Event fires up. For example,

Private Sub Workbook_Open()
    MyMacro
    'Call MyMacro
    'Run "MyMacro"
End Sub

Sub MyMacro()
    MsgBox "This macro fires at Workbook_Open Event", vbInformation, "Info"
End Sub

This shows a message box with the string This macro fires....

Let's for now think of it as the macro that updates your records. Now, the records are being updated and you want to refresh your workbook.

You hit ALT + F8 or navigate to a View Macros window and find MyMacro macro and run it!

Upvotes: 1

Related Questions