naveen dayalan
naveen dayalan

Reputation: 49

How to copy the hyperlink from with # in Excel VBA

Cell hyperlink = "https://windchill.com/Windchill/app/#ptc1/tcomp/infoPage?ContainerOid=OR%3Awt.pdmlink.PDMLinkProduct%dfasdfasdfasdf&oid=VR%3Awt.doc.WTDocument%"

Vba code:

Url = activecell.hyperlinks(1).address

Result:

Url = "https://windchill.com/Windchill/app/"

I need full hyperlink but I am getting result up to before #

How can I resolve this issue?

Upvotes: 0

Views: 384

Answers (1)

Dávid Laczkó
Dávid Laczkó

Reputation: 1101

It splits the address in 2 properties for me and it needs to be rebuilt:

Url = activecell.hyperlinks(1).Address & "#" &activecell.hyperlinks(1).SubAddress

Upvotes: 1

Related Questions