1

I have an excel spreadsheet that has 8 connections. I would like to know what connection string corresponds to which datatable/pivot table in excel. A solution in 2007 or 2010 method is fine.

Is this possible?

2 Answers 2

3

It is possible using the Data tab.

Try this:

-- Click on Connections in the Data tab to bring up the Workbook Connections dialog.

Excel Data --> Connections

-- Click on a connection in the list.

List of Workbook Connections

-- Click the link: click here to see where the selected connections are used

Show where data connections are used in Workbook

Sign up to request clarification or add additional context in comments.

1 Comment

That was it. Odd how Microsoft made that link in black text. Didn't really stand out. Thanks!
0

This is possible from VBA too. This query just enumerates them.

You can readily modify this example to refresh the queries using PivotCache.Refresh or QueryTable.Refresh.

Sub ShowAllQueryConnectionStrings()
    Dim oSheet As Excel.Worksheet
    For Each oSheet In Application.ActiveWorkbook.Sheets
        Dim oTable As Excel.QueryTable
        For Each oTable In oSheet.QueryTables
            Debug.Print "QueryTable " & oTable.Name & ": " & oTable.Connection
        Next
        Dim oPivot As Excel.PivotTable
        For Each oPivot In oSheet.PivotTables
            Debug.Print "PivotTable " & oPivot.Name & ": " & oPivot.PivotCache.Connection
        Next
    Next
End Sub

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.