Consulting

Results 1 to 5 of 5

Thread: Refresh specific power queries within workbook

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Dec 2020
    Posts
    48
    Location

    Refresh specific power queries within workbook

    Hi,

    Wondering if anyone has figured out how delete specific queries in a workbook?

    The below deletes all, but I want to remove a specific one as well before

    Public Sub RemoveQueries()
    
    'Removes all PowerQueries from Workbook
    Dim cn As WorkbookConnection
    Dim qr As WorkbookQuery
        On Error Resume Next
        For Each cn In ThisWorkbook.Connections
            cn.Delete
        Next
        For Each qr In ThisWorkbook.Queries
            qr.Delete
        Next
    End Sub
    PS: See Post $4. st
    Last edited by SamT; 05-04-2021 at 05:29 AM.

Tags for this Thread

Posting Permissions

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