I've got a URL that looks like this:
http://w2k16x3v12:8124/syracuse-main/html/main.html?url=http%3A%2F%2Fw2k16x3v12%3A8124%2Fsdata%2Fx3%2Ferp%2FSEED%2FITMMASTER(%27FIN001%27)%3Frepresentation%3DITMMASTER.%2524details%26profile%3D~(loc~%27en-US~role~%2788e4bf9f-e803-490d-a74e-9df1f1bfb962~ep~%27129eb6a5-9207-428b-8810-27875970b26a~appConn~())
As you can see, the 'url' parameter is another URL which in turn has its own parameters. This url works fine in these scenarios:
- When pasted into the address bar
- When accessed through an HTML element
- When accessed in a PDF document, as a hyperlink In each of these cases, the 'url' parameter gets encoded automatically (in Chrome, anyway).
However, when this same URL is used as a hyperlink in Excel, something interesting happens. The 'url' parameter gets omitted up to the first parameter of that 'url', like so:
http://w2k16x3v12:8124/syracuse-main/html/main.html?url=%3Frepresentation%3Dhome.%2524landing%26profile%3D~(loc~%27en-US~role~%2788e4bf9f-e803-490d-a74e-9df1f1bfb962~ep~%27129eb6a5-9207-428b-8810-27875970b26a~appConn~())
As you can see,
http%3A%2F%2Fw2k16x3v12%3A8124%2Fsdata%2Fx3%2Ferp%2FSEED%2FITMMASTER(%27FIN001%27)
is omitted from the url.
It looks like Excel is "sanitizing" the URL before opening it. This behavior is consistent when tested on different browsers. When editing or hovering over the hyperlink, the link is correct. Is this URL not well-made? There is almost no flexibility with this URL - encoding/decoding parameters is about the most I can do.
How do I make Excel open the hyperlink as is, instead of first changing it?
Tested on MS Excel for Office 365 ProPlus, version 1902
For clarity, the decoded URL looks like this:
http://w2k16x3v12:8124/syracuse-main/html/main.html?url=http://w2k16x3v12:8124/sdata/x3/erp/SEED/ITMMASTER('FIN001')?representation=ITMMASTER.$details&profile=~(loc~'en-US~role~'88e4bf9f-e803-490d-a74e-9df1f1bfb962~ep~'129eb6a5-9207-428b-8810-27875970b26a~appConn~())
and here's the decoded URL of what Excel makes of it:
http://w2k16x3v12:8124/syracuse-main/html/main.html?url=?representation=ITMMASTER.$details&profile=~(loc~'en-US~role~'88e4bf9f-e803-490d-a74e-9df1f1bfb962~ep~'129eb6a5-9207-428b-8810-27875970b26a~appConn~())