Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default pivot table connection access

hi

the following macro gets stuck where show below

Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
Dim pc As PivotCache
Dim pt As PivotTable

con.Open "provider=microsoft.jet.oledb.4.0;" & _
"data source=C:\Users\M Varnendra\Desktop\VBA on Excel\Chapter 22\salesdb.mdb"
sql = "select * from sales"

Set pc = ActiveWorkbook.PivotCaches.Add(SourceType:=xlExter nal)
Set pc.Recordset = rs

'''''getting stuck here
Worksheets.Add befo=Sheets(1)
Set pt = ActiveSheet.PivotTables.Add(PivotCache:=pc, _
tabledestination:=Range("a1"))

know about it?

thank
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default pivot table connection access

guys

whats up

rs.Open sql, con was missing. now its working



"vavasoo" wrote:

hi

the following macro gets stuck where show below

Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
Dim pc As PivotCache
Dim pt As PivotTable

con.Open "provider=microsoft.jet.oledb.4.0;" & _
"data source=C:\Users\M Varnendra\Desktop\VBA on Excel\Chapter 22\salesdb.mdb"
sql = "select * from sales"

Set pc = ActiveWorkbook.PivotCaches.Add(SourceType:=xlExter nal)
Set pc.Recordset = rs

'''''getting stuck here
Worksheets.Add befo=Sheets(1)
Set pt = ActiveSheet.PivotTables.Add(PivotCache:=pc, _
tabledestination:=Range("a1"))

know about it?

thank

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
Connection of Excel 07 pivot table to Access Query makes DB read o Chuck W[_2_] Excel Discussion (Misc queries) 0 October 9th 09 03:45 PM
Pivot Table connection String Max Scott[_3_] Excel Programming 0 February 26th 09 10:33 AM
Pivot table access - Connection Candyman Excel Programming 1 June 5th 08 08:40 PM
Pivot Table Data Connection J.Rogers Excel Programming 0 June 28th 06 08:56 PM
Pivot Table Connection Steven Taylor[_3_] Excel Programming 5 November 19th 03 02:40 PM


All times are GMT +1. The time now is 06:39 AM.

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

About Us

"It's about Microsoft Excel"