Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Forgot to say thanks - Thanks!
"Carim" wrote: Marie, You are right ... View Code and then the icon Object Browser ... Meanwhile, found the following VBA code to ChangeServer Sub ChangeServer() 'Declare your variables. Dim ptc As PivotCache, oldSrv As String, newSrv As String 'Request the name of the old server/file name. oldSrv = InputBox("Input the name of the old server or file path as listed in the Pivot Tables SQL string.") 'Request the name of the new server/file name. newSrv = InputBox("Input the name of the new server or file path which you want the Pivot Table to point to.") 'Replace the ODBC information of whatever PivotTable is currently active. Set ptc = ActiveCell.PivotTable.PivotCache ptc.Connection = Application.Substitute(ptc.Connection, oldSrv, newSrv) ptc.Sql = Application.Substitute(ptc.Sql, oldSrv, newSrv) End Sub HTH Cheers Carim |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
External data query leaves datasource workbook open | Excel Discussion (Misc queries) | |||
External data not updating | Excel Discussion (Misc queries) | |||
AHHHH-Get Data from Multiple Excel workbooks | Excel Discussion (Misc queries) | |||
External Data | Excel Discussion (Misc queries) | |||
Prompting to allow External Query Data Refresh | Excel Discussion (Misc queries) |