No editing allowed? Excel DSN editing!

  • Anyone know how to edit an Excel DSN?

    I've inherited some Excel docs (available on a shared network drive) that may have DSN issues. We'd like to find out what DSNs are being accessed.

    I can't find where to edit the DSN info from Excel. Can anyone help?

    Thanks

  • Use the connection property of either a pivotcache or querytable... a little sub like this will list them all for you:

    Sub showconnections()

    Dim pc As PivotCache

    For Each pc In ActiveWorkbook.PivotCaches

        Debug.Print pc.Connection

    Next

    Dim ws As Worksheet

    Dim qt As QueryTable

    For Each ws In ActiveWorkbook.Worksheets

        For Each qt In ws.QueryTables

            Debug.Print qt.Connection

        Next qt

    Next ws

    End Sub

    Good luck!

    JR

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply