pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
Hi, can Vba refresh data connection with password?
I tried myself different ways but didnt know what to do...i mean the right way...I also googled but no luck.
Please advice.
I tried myself different ways but didnt know what to do...i mean the right way...I also googled but no luck.
Please advice.
Code:
[/FONT]
[FONT=Courier New]Option Explicit
Sub refresh()
With ActiveSheet.PivotTables("PivotTable1")
.Connection.Password = "123"
.PivotCache.refresh
End With
End Sub