+ Reply to Thread
Results 1 to 7 of 7

Deleting External Connections

Hybrid View

  1. #1
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Deleting External Connections

    Hello rjj920,

    This macro will remove them. Add a New VBA module to your workbook and paste this code into it. You can run the macro using the ALT+F8 while in Excel to bring up the macro dialog.

    Sub RemoveConnections()
    
        Dim qt As Object
        
            For Each qt In ActiveSheet.QueryTables
                qt.Delete
            Next qt
        
    End Sub
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  2. #2
    Forum Contributor
    Join Date
    12-09-2015
    Location
    Virginia, USA
    MS-Off Ver
    Excel 365
    Posts
    129

    Re: Deleting External Connections

    Thanks, Leith. I am still having a hard time reestablishing the connection to pull that same file and generating a new report (i.e. when I remove the connection 0418.csv and then rerun my macro to repull the new 0418.csv file, I get the cannot connect error). I'm hoping there is an easy way to generate new connections automatically without too much hassle.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. External data connections are removed
    By edk74 in forum Excel General
    Replies: 1
    Last Post: 01-18-2018, 07:37 AM
  2. Replies: 2
    Last Post: 02-18-2017, 04:11 AM
  3. [SOLVED] Work in connections with external data
    By kiluwa99 in forum Excel General
    Replies: 3
    Last Post: 06-28-2016, 01:03 AM
  4. Replies: 0
    Last Post: 05-14-2015, 05:16 AM
  5. external data connections are not refreshing even with VBA
    By krishna2221 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2014, 04:00 AM
  6. When are External Connections not QueryTables?
    By apolloni in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-07-2013, 08:11 AM
  7. external data - cleanup existing connections
    By edstevens in forum Excel General
    Replies: 1
    Last Post: 04-26-2013, 12:03 PM

Tags for this Thread

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