Weird bug in PowerQuery hyperlink generation?

ks_12345

New Member
Joined
Jun 25, 2019
Messages
1
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<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? </url>:confused:
 

Some videos you may like

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

RicoS

New Member
Joined
May 1, 2019
Messages
18
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
 

Watch MrExcel Video

Forum statistics

Threads
1,102,454
Messages
5,486,996
Members
407,575
Latest member
calc

This Week's Hot Topics

Top