Hello again everyone!
I appreciate all the help on this site, I'm learning a lot! I had a question about the order in which data updates in an excel 2003 spreadsheet.
I have a workbook that uses 2 ODBC queries to update on open (one for each tab.) I also have the pivot table set to update on open. Which one updates first though? I need my ODBC connection to update the data first so that when the pivot updates, it shows the new data.
I know Excel 2003 doesn't update pivot information automatically, even if you have "update on open" checked within the pivot table properties. To get around this, I have borrowed some VBA code from another site. (I can't remember which one now.)
VBA:
[pre]
[/pre]
This should get around the update issue, correct?
Recap:
1. Does ODBC data refresh before or after the pivot table refreshes?
2. Does the above VBA script work to make all pivot tables update in a workbook?
Thanks a million!
I appreciate all the help on this site, I'm learning a lot! I had a question about the order in which data updates in an excel 2003 spreadsheet.
I have a workbook that uses 2 ODBC queries to update on open (one for each tab.) I also have the pivot table set to update on open. Which one updates first though? I need my ODBC connection to update the data first so that when the pivot updates, it shows the new data.
I know Excel 2003 doesn't update pivot information automatically, even if you have "update on open" checked within the pivot table properties. To get around this, I have borrowed some VBA code from another site. (I can't remember which one now.)
VBA:
[pre]
Code:
Sub RefreshAllPivotTables()
Dim PT As PivotTable
Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
For Each PT In WS.PivotTables
PT.RefreshTable
Next PT
Next WS
End Sub
This should get around the update issue, correct?
Recap:
1. Does ODBC data refresh before or after the pivot table refreshes?
2. Does the above VBA script work to make all pivot tables update in a workbook?
Thanks a million!