I have several excel tools that use pivot tables to get and process data from Access. THese tools have multiple (many) pivot tables. This becomes a burden when I need to refresh the data in the pivot tables. so I use the macro
Sub Refresh_All_PT_WS() 'Refresh all pivot tables active worksheet
Dim pt As PivotTable
For Each pt In ActiveSheet.PivotTables
pt.RefreshTable
Next pt
End Sub
and it works great. However my data is password protected (in Access) so once I start the macro it asks me to input the password for every table as it updates.
NOw the question...Does anyone know a way to use an input box to ask for the password once when the macro starts (simple enough) and use it throughout the macro as it loops and apply it when the password box appears (the hard part)? Alternately since this macro is only in my "PERSONAL" workbook is there a way to insert the password directly into the macro loop (without user input) so it is applied automatically each time the request appears?
Thanks
Sub Refresh_All_PT_WS() 'Refresh all pivot tables active worksheet
Dim pt As PivotTable
For Each pt In ActiveSheet.PivotTables
pt.RefreshTable
Next pt
End Sub
and it works great. However my data is password protected (in Access) so once I start the macro it asks me to input the password for every table as it updates.
NOw the question...Does anyone know a way to use an input box to ask for the password once when the macro starts (simple enough) and use it throughout the macro as it loops and apply it when the password box appears (the hard part)? Alternately since this macro is only in my "PERSONAL" workbook is there a way to insert the password directly into the macro loop (without user input) so it is applied automatically each time the request appears?
Thanks