HyperLink Blues (Going Bald)

V

VKY

Hey All,

I just wanted to have a shape hyperlinked to another, which is easy
enough by typing into subaddress "Page-2/Sheet.1". The problem is that
when the page name is changed (Page-1 changed to Test), then the link
will be broken, and no longer works.

I therefore has to create a user cell on the PageSheet, "User.PageName"
where the formula for this cell is PageName(). Then I have to type into
the subaddress cell ThePage!User.PageName & "/Sheet.1", and even though
the page name will change, Visio will automatically update so my
subaddress link will always work.

a) Is there a better way?

All problems comes when I tried to implement the above programmatically.
When I tried to set

Link.SubAddress = "ThePage!User.PageName & ""/Sheet.1"""

in my program, the formula in the subaddress cell becomes:

"ThePage!User.PageName & ""/Sheet.1"""

and not

ThePage!User.PageName & "/Sheet.1"

which creates a non-working link. Even when I tried to remove the first
and the last quote, it is not possible as Link.SubAddress returns

ThePage!User.PageName & "/Sheet.1"

PLEASE HELP, is there a way to set a link to another shape and have the
link still working even though the page name has changed?

A MILLION THANKS IN ADVANCE.
 
C

Crack

extra quotations in the desired string ?

Try

Link.SubAddress = "ThePage!User.PageName & ""/Sheet.1"""
try
dim strng as string
' write to a string first
strng = "ThePage!User.PageName & ""/Sheet.1"""

'trim the leading and trailing quotations from the strng variable
Link.SubAddress = mid(strng,2,len(strng))

'i think the mid function requires a starting and finishing point within the
targeted string and the len function returns the magnitude of length of the
string.
 
V

VKY

No luck crack.

Link.SubAddress = "ThePage!User.PageName & ""/Sheet.1"""

will not make Link.SubAddress = ThePage!User.PageName & "/Sheet.1"

Nor will assigning to a string first, then assigning the string to the
SubAddress property.

I have found a way though, that is to store:

"ThePage!User.PageName & ""/Sheet.1""" into another user cell
(User.GoTo), and manually create the shape so that the default hyperlink
has it SubAddress = User.Goto. User.GoTo cell will understand that

"ThePage!User.PageName & ""/Sheet.1"""

the first part being a formula and second part being a string, rather
than have the SubAddress cell think that the whole damn thing is a string.

VKY
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top