none
Excel 2016: dynamically update the source URL with Power Query with a value in a certain cell RRS feed

  • Question

  • Hello, 

    Firstly I'm an IT PRO, so I'm sorry if ask crazy questions :-)

    I need dynamically update the source URL with Power Query with a value in a certain cell.

    My query:

    let
    
        Source = Web.Page(Web.Contents("https://website/_layouts/CommerceServer/IM/ProductDetails.aspx?id=IT01@@7000@@10@@2M2VA49"))
    in
        Source

    2M2VA49 should be a variable that I write in a certain cell.

    My goal is:  Insert the value (variable) in A1  and return a result of the Power Query in B1 and so on for A2,A3 .. B2,B3..

    Thank you

    Friday, February 23, 2018 10:45 AM

All replies

  • Hi Andrea,

    How did you use this code?

    For accessing the A1 cell in Excel, you could try code below:

    Sub Test()
    'Source = Web.Page(Web.Contents("https://www.baidu.com"))
    Debug.Print ActiveWorkbook.Worksheets("Sheet1").Range("A1").Value
    End Sub

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 26, 2018 8:28 AM
  • Hi Tao,

    Thank you for your reply.

    My code is related to PowerBI, M and PQ. Your example seems in vba, right?

    tnx

    Monday, February 26, 2018 8:58 AM
  • Hi Andrea,

    Yes, it's VBA code.

    For Power Query related issue, I suggest you post your issue in forum below:

    https://social.technet.microsoft.com/Forums/en-us/home?forum=powerquery

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 26, 2018 9:46 AM