C
Carlos
Hi,
I need help modifying the sql statemnet for a pivot table. I create a pivot
table using ODBC connection. I created fine and even the refresh work fine.
But when I need to modify the query to add new conditions to the sql
statement, the pivot pivot still refreshes with the old slq. It does get
change.
refrsh code:
' odbc connection and sql statement would be here::
Sub RefreshPivotTables()
'This routine calls the refresh method for each sheet's pivot table
Dim sSheet As String
Application.ScreenUpdating = False
Set wbBook = ThisWorkbook
Set wsSheet = wbBook.Worksheets(sSheet)
Set ptCache = wbBook.PivotCaches(1)
Set ptTable = wsSheet.PivotTables(sSheet)
ptTable.RefreshTable
Application.ScreenUpdating = True
End Sub
Any help would be appreciated. Thanks.
I need help modifying the sql statemnet for a pivot table. I create a pivot
table using ODBC connection. I created fine and even the refresh work fine.
But when I need to modify the query to add new conditions to the sql
statement, the pivot pivot still refreshes with the old slq. It does get
change.
refrsh code:
' odbc connection and sql statement would be here::
Sub RefreshPivotTables()
'This routine calls the refresh method for each sheet's pivot table
Dim sSheet As String
Application.ScreenUpdating = False
Set wbBook = ThisWorkbook
Set wsSheet = wbBook.Worksheets(sSheet)
Set ptCache = wbBook.PivotCaches(1)
Set ptTable = wsSheet.PivotTables(sSheet)
ptTable.RefreshTable
Application.ScreenUpdating = True
End Sub
Any help would be appreciated. Thanks.