I have a connection to a SQL table in my excel workbook pulling accounting data.
I have a macro that refreshes the workbook, so that my table is up to date.
I have another macro that hides blank rows (Income Statement accounts with no activity)
When I refresh my connection, there is an approximate 7 second delay from hitting refresh (whther through the macro ThisWorkbook.RefreshAll) or going to data and clicking refresh) and when it actually begins updating my table (it takes another 40 seconds to load about a 100k records).
I want my macro to refresh the data then call the other macro to hide blank rows. Except that its calling the other macro during the 7 second delay, before my data is ever refreshed. Forcing a delay between refresh and call doesnt work.
Current code that doesnt work (with or without the Wait). Its hiding blank rows before the table is refreshed.
Sub Refresh()
ThisWorkbook.RefreshAll
Application.Wait (Now + TimeValue("0:00:10"))
Call Hide_Blank_Rows
End Sub
I have a macro that refreshes the workbook, so that my table is up to date.
I have another macro that hides blank rows (Income Statement accounts with no activity)
When I refresh my connection, there is an approximate 7 second delay from hitting refresh (whther through the macro ThisWorkbook.RefreshAll) or going to data and clicking refresh) and when it actually begins updating my table (it takes another 40 seconds to load about a 100k records).
I want my macro to refresh the data then call the other macro to hide blank rows. Except that its calling the other macro during the 7 second delay, before my data is ever refreshed. Forcing a delay between refresh and call doesnt work.
Current code that doesnt work (with or without the Wait). Its hiding blank rows before the table is refreshed.
Sub Refresh()
ThisWorkbook.RefreshAll
Application.Wait (Now + TimeValue("0:00:10"))
Call Hide_Blank_Rows
End Sub