LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complicated ODBC data refresh question. JDNETTC Excel Discussion (Misc queries) 6 January 30th 08 11:36 PM
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
Refresh spreadsheet from database through ODBC Souris Excel Programming 1 August 11th 05 11:57 PM
Timing of automatic query refresh and macro pivot table refresh dutty Excel Programming 2 December 1st 04 07:19 PM
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH Ken Roberts Excel Programming 3 September 11th 03 06:02 AM


All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"