Results 1 to 2 of 2

Thread: Weird bug in PowerQuery hyperlink generation?
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jun 2019
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Weird bug in PowerQuery hyperlink generation?

    I have a sheet that generates hyperlinks automatically based on other cell values using a custom column. It has been working fine until now, but I just started seeing some weird bugs in it.

    My custom column fomula is as follows:

    Code:
    "'=HYPERLINK(""" & "URL/files/J01009/" & [Account_Number] & "/" & [Photo_account_verification] & """,""" & [Photo_account_verification] & """)"
    I'm adding an apostrophe to the beginning of the hyperlink, the reason is explained below:
    - Without the apostrophe, the column directly returns the formula in the format: =HYPERLINK("URL","FriendlyName")
    - But this is not a clickable link when it is generated by PowerQuery
    - To workaround this, I am making the PowerQuery return the hyperlink with an apostrophe in the beginning, and then running a macro to replace '= with =
    - After running the macro, the cells return clickable links.

    This has been working great till now.

    But now, please see the following returned by Powerquery:

    Contents of K11:
    (There's a problem in this, as there are two apostrophes in the beginning instead of one)


    Contents of K12:
    (This is normal and expected)


    Please see the difference between what is the contents of K11 in the formula bar vs what is shown in the sheet.



    Due to this, once I run the Find_Replace macro, K12 gives me a clickable hyperlink but K11 does not!
    I'm beating my head over this, please someone help?

  2. #2
    New Member
    Join Date
    May 2019
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Weird bug in PowerQuery hyperlink generation?

    Just remove the quote from the hyperlink in the power query formula and it will return the correct hyperlink formula as text. Then in VBA, just use:

    Range("yourQueryTableName[Photo - Account Verification...]").Formula =
    Range("yourQueryTableName[Photo - Account Verification...]").Formula

    This will change to formula in text to the actual formula value

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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