excel pivot table linked to external source

M

marina madeleine

I have an excel pivot table which has a live link to an external source
(an Access database). How can you tell to which access table the pivot
table is linked? Is there a place in the pivot table where this info
could be found?

Thanks.

Marina



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
K

keepITcool

if your programming:
it's stored via the connection property of the pivotcache

for manual editing :
select a cell inside the pivottable
rightclick
select Wizard
the wizard will show Page3 of 3
select the "Back" button

by clicking the GetData button on Page2 of 2
you can rerun the query (with an option)
to edit it in MsQuery..
THEN in SQL mode you can see the table..

complicated isn't it?


thus .. try following macro..

Sub ShowPivotConnection()
Dim pt As PivotTable

On Error Resume Next
Set pt = ActiveCell.PivotTable
On Error GoTo 0
If pt Is Nothing Then
MsgBox "No PT selected"
Else
MsgBox Replace(pt.PivotCache.Connection, ";", vbNewLine)
End If
End Sub
 
J

Jamie Collins

keepITcool said:
edit it in MsQuery..
THEN in SQL mode you can see the table..

I tried this myself and the text in the SQL window was as follows:

{Call MyStoredProc('2001-01-01', '2004-01-01')}

Do I now have to query a system table? Something like:

Dim oConn As Object
Dim oRs As Object

Set oConn = CreateObject("ADODB.Connection")
With oConn
.CursorLocation = 3 ' adUseClient
.ConnectionString = CONN_STRING
.Open

' adSchemaProcedures
Set oRs = .OpenSchema(16, _
Array(Empty, Empty, "MyStoredProc", Empty))

oRs.ActiveConnection = Nothing
.Close

End With

MsgBox oRs!PROCEDURE_DEFINITION
complicated isn't it?

Things aren't always straightforward <g>.

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top