Hyperlink changes from # to - when clicked in Ex

2020-06-30 04:31发布

I've got a hyperlink in an Excel 2013 sheet that links to an internal website. When I right click and select "edit hyperlink", I see this in the address bar (which is correct):

https://myserver.company.com/home/default.html#article?id=1203291003

However, when I left click, middle click, or right click -> open hyperlink I get the same behavior: IE11 opens and I get a http 404 error because the link (shown below) is not found.

https://myserver.company.com/home/default.html%20-%20article?id=1203291003

What could be converting the # to %20-%20? This is very odd because %20 is a space and there are no spaces in the URL.

标签: excel
15条回答
我欲成王,谁敢阻挡
2楼-- · 2020-06-30 04:54

Please try the below thread in order to get the URL to open from the IE window by its address using VBA

Using VBA to send url to an active IE window

Example below:

Dim IE As Object
Dim objCollection As Object

' Create InternetExplorer Object
Set IE = CreateObject("InternetExplorer.Application")

' Send the form data To URL As POST binary request
IE.Navigate "https://YOURURL/niku/nu#action:projmgr.projectDefaultTab&id=5558967"

' Clean up
Set IE = Nothing

Hope this works for you as it does for me. AmiK

查看更多
混吃等死
3楼-- · 2020-06-30 04:57

I was able to get around this by using %23 in place of the # (hashtag|pound sign). My URL's now work within Excel 2013. The 'hovertext' shows the # symbol in the URL, but editing the link shows the %23.

http://www.example.com/page#location does not work

http://www.example.com/page%23location works

查看更多
唯我独甜
4楼-- · 2020-06-30 04:57

In Excel 2013, you can use the encodeurl(url) function.

Example

Source: http://versitas.com/blog/two-easy-ways-to-encode-urls-in-excel/

You can then pass the encoded URL to the hyperlink(link_location,[friendly_name]) function to display a more readable URL.

查看更多
一纸荒年 Trace。
5楼-- · 2020-06-30 04:57

I pasted the report into a new message in Outlook and the hyperlinks worked fine. It did not work when pasting into Word, nor did pasting them back into Excel from Outlook. (Using Office Professional Plus 2010 for all three apps).

I later followed the suggestion above regarding default browser. I went into Chrome and made it my default. Then closed Chrome. Then went into IE and made it my default. No reboot. Links worked.

查看更多
在下西门庆
6楼-- · 2020-06-30 04:58

This is really annoying but there's a simple workaround: don't use the URL with the # but use an URL-shortener service like https://goo.gl/

查看更多
Root(大扎)
7楼-- · 2020-06-30 05:04

Go to Control Panel -> All Control Panel Items -> Default Programs -> Set Default Programs and select Setup Internet Explorer as Default Browser.

Close all Internet Explorer tabs and try again.

查看更多
登录 后发表回答