Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Refreshing Pivot tables link to a SQL Server

I have 2 pivot tables in an EXCEL workbook that are linked to tables located
on a SQL Server. The end user will be responsible for refreshing these tables
by clicking a button. Right now a dialog box appears and requires the user to
enter an id and password for each table. I want to have the pivot tables
refresh on open without prompting for a password. Is this possible.

I have started to write the following code but I don't know if I am on the
right track.

Sub Refresh_Data()
'Set up the connection string, reference an ODBC connection
connstring = _
"ODBC;DSN=Gulf States SQL Server;UID=e45768;PWD=e45768;Database=DataMart"
'Refresh Pivot Tables
Worksheets("PvtTbls").PivotTables("PivotTable1").P ivotCache.Refresh
Worksheets("PvtTbls").PivotTables("PivotTable2").P ivotCache.Refresh

End Sub

I am a programming novice and not sure how to make this work. Any help would
be greatly appreciated.
Reply
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
Refreshing Pivot Tables hnyb1 Excel Discussion (Misc queries) 1 September 13th 07 01:21 PM
When refreshing pivot tables my pivot table chart type changes hannah220507 Excel Discussion (Misc queries) 1 May 22nd 07 02:57 PM
Refreshing Pivot Tables Lisa Excel Worksheet Functions 2 May 17th 07 04:19 PM
Refreshing Pivot Tables QUery Ron McCormick[_2_] Excel Programming 1 December 3rd 03 06:31 PM
Pivot Tables - Refreshing with data??..... MrAlMackay Excel Programming 2 September 9th 03 08:47 PM


All times are GMT +1. The time now is 03:02 AM.

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"