Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pivot Refresh over ODBC
I have a series of workbooks containing 2 or more Pivot Tables. Each table
refreshes from an external source over an ODBC connection. The user is prompted for username/password for each table refresh. I'd like to have a UserForm capture the username/password once and then code VBA to supply it on each refresh. I've found this snipet of code (thanks to this forum), but do not know how to proceed. Dim oODBCConnection As OdbcConnection Dim sConnString As String = _ "Dsn=myDsn;" & _ "Uid=myUsername;" & _ "Pwd=myPassword" oODBCConnection = New Odbc.OdbcConnection(sConnString) oODBCConnection.Open() Any thoughts on how to do this? Thanks in advance!!! My current code: For Each sht In ActiveWorkbook.Worksheets For i = 1 To sht.PivotTables.count Set pvt = sht.PivotTables(i) pvt.RefreshTable Next i Next sht |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Complicated ODBC data refresh question. | Excel Discussion (Misc queries) | |||
Create refresh button in worksheet to refresh Pivot Table Data | Excel Worksheet Functions | |||
Refresh spreadsheet from database through ODBC | Excel Programming | |||
Timing of automatic query refresh and macro pivot table refresh | Excel Programming | |||
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH | Excel Programming |