krizma5683
Technical User
I'm trying to find out if there's a way to code the user name and password that needs to be entered when trying to refresh a pivot table that is built from an ODBC datasource?
I've written some code to refresh my pivot table, but I get an error when I try to refresh & I suspect it's becuase it can't find the user login information to the datasource.
This is my code:
Thanks!
I've written some code to refresh my pivot table, but I get an error when I try to refresh & I suspect it's becuase it can't find the user login information to the datasource.
This is my code:
Code:
Application.ScreenUpdating = False
Sheets("External Data").Visible = True
ActiveSheet.PivotTables("PivotTable3").PivotCache.Refresh
ActiveWindow.SelectedSheets.Visible = False
Sheets("Material Costs").Visible = True
ActiveSheet.PivotTables("PivotTable2").PivotCache.Refresh
ActiveWindow.SelectedSheets.Visible = False
Sheets("Calculator").Select
Range("A2").Select
Application.ScreenUpdating = True
Thanks!