+ Reply to Thread
Results 1 to 2 of 2

Deleting Connections in a Workbook

  1. #1
    Valued Forum Contributor SDruley's Avatar
    Join Date
    04-27-2009
    Location
    Conover, NC
    MS-Off Ver
    Excel 2010 64 bit
    Posts
    415

    Smile Deleting Connections in a Workbook

    Sub DeleteAllWorkbookConnections()
    Dim Cn As Connection
    For Each Cn In Connections
    Cn.Delete
    Next
    End Sub


    This would seem to be very efficient code for deleting all of the connections associated with a query table in a Workbook. I realize that my understanding of doing this is insufficient and that the code I have written is more conceptual.

    1) What modifications could I make to have the correct syntax?
    2) Does this really delete the connections or are they still there?

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Deleting Connections in a Workbook

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1