Results 1 to 3 of 3

Power Query - Excel.CurrentWorkbook

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    327

    Power Query - Excel.CurrentWorkbook

    Hi

    I currently have the M code below that queries a Workbook called Budget.xlsm. I want to change that to query the workbook that the query sits in - for instance Book1.xlsm

    I guess I will use the M Code Excel.CurrentWorkbook but I don't know how to replace the File.Contents portion of the Code if I was to use Excel.CurrentWorkbook.

    Can someone advise how I would change eth code to refer to the current workbook?

    Allister



    let
        Source = Excel.Workbook(File.Contents("S:\Budget.xlsm"), null, true),
        #"Filtered Rows3" = Table.SelectRows(Source, each ([Kind] = "Sheet")),
        #"Filtered Rows1" = Table.SelectRows(#"Filtered Rows3", each Text.StartsWith([Name], "bd")),
        #"Expanded Data" = Table.ExpandTableColumn(#"Filtered Rows1", "Data", {"Column1", "Column2", "Column3"})
       
    in
        #"Expanded Data"
    Last edited by AllisterB; 02-23-2021 at 03:17 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Power Query to transform current table
    By Vixx1 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-16-2020, 12:28 PM
  2. [SOLVED] Power Query - excel formula translation into Power Query
    By afgi in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 02-19-2020, 03:38 AM
  3. Replies: 4
    Last Post: 02-17-2020, 06:03 AM
  4. [SOLVED] Power Query - load to workbook and create query table
    By jaryszek in forum Excel General
    Replies: 1
    Last Post: 12-10-2019, 11:09 AM
  5. Power Query: combine sheets from different workbook
    By erica.ho56458 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2018, 02:28 AM
  6. 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
  7. Validate if value exist in current power query connection data
    By calvinle in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-05-2017, 01:03 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