+ Reply to Thread
Results 1 to 3 of 3

Use VBA to remove all power query connections with DocumentInspector

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Use VBA to remove all power query connections with DocumentInspector

    I have a sheet with table formatting that I need to keep when copy / paste special. However I want to delete all the power query connections. Ive been able to accomplish this manually by going into document inspector and removing all wherever possible. I recorded a macro which displayed results however this doesnt work when i try to actually use the code.

    Here is the VBA code I'm using. This code copys a sheet from one workbook, creates a new workbook and pastes special all using source theme. The .REmoveDocumentInformation (xlRDIPrinterPath) is what I got from the macro recording that doesn't seem to do anything when I put it to use.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Use VBA to remove all power query connections with DocumentInspector

    If you want to delete all queries and connections... in the new workbook.

    Something like below.
    Please Login or Register  to view this content.
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Use VBA to remove all power query connections with DocumentInspector

    Quote Originally Posted by CK76 View Post
    If you want to delete all queries and connections... in the new workbook.

    Something like below.
    Please Login or Register  to view this content.
    That did it! Thanks

+ 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. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  2. Replies: 3
    Last Post: 04-20-2018, 08:30 AM
  3. Replies: 0
    Last Post: 04-05-2018, 01:16 AM
  4. Does My VBA Code To Refresh CSV Power Query Connections Need To Change for MySQL Queries?
    By beaglesBuddy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2017, 02:57 PM
  5. Power Query - Storing and Connections
    By James McEwan in forum Excel General
    Replies: 0
    Last Post: 08-09-2016, 08:19 AM
  6. How to remove null values from several columns with Power Query?
    By toblju in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2016, 11:08 AM
  7. Remove Unique rows in Power Query
    By danielmorrison in forum Excel General
    Replies: 2
    Last Post: 03-11-2016, 09:06 AM

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