Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code Problem
I am trying to click on a command button in a worksheet that will refresh
pivot tables and ODBC connections throughout my workbook. The code seems to work well to refresh the pivot tables, but once it hits the ODBC data it errors out. Can someone help me with my code? Sheets("Sheet1").PivotTables("PivotTable1").Refres hTable Sheets("Sheet2").PivotTables("PivotTable1").Refres hTable Sheets("Sheet3").Select Range("A1").Select Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("Sheet4").Select Range("A1").Select Selection.QueryTable.Refresh BackgroundQuery:=False -- Drew |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code Problem
Drew wrote:
I am trying to click on a command button in a worksheet that will refresh pivot tables and ODBC connections throughout my workbook. The code seems to work well to refresh the pivot tables, but once it hits the ODBC data it errors out. Can someone help me with my code? Sheets("Sheet1").PivotTables("PivotTable1").Refres hTable Sheets("Sheet2").PivotTables("PivotTable1").Refres hTable Sheets("Sheet3").Select Range("A1").Select Selection.QueryTable.Refresh BackgroundQuery:=False Sheets("Sheet4").Select Range("A1").Select Selection.QueryTable.Refresh BackgroundQuery:=False Maybe this will work better for you. Works equally well for pivot tables and ODBC sources. Sub RefreshAllPivotTables_n_Such() ActiveWorkbook.RefreshAll End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem with code (error code 9) | Excel Programming | |||
Problem with code | Excel Programming | |||
code problem | Excel Programming | |||
Code Problem | Excel Programming | |||
problem with code | Excel Programming |