Hyperlink Address Length Restriction

G

Guest

I'm trying to add some rather lengthy hyperlinks, and I'm coming across an
apparent length restriction. The URLs I'm trying to add often include some
query-looking stuff that looks like ASP (I'm not familiar with ASP). For
example,
"http://www.someplace.com/AllItems.aspx?RootFolder=/blahblahblah...". It
looks like the address gets truncated after 256 characters. I've tried the
HYPERLINK() function, the Insert>Hyperlink menu item, as well as adding
hyperlinks with VBA, but I get the same result. Am I missing something, or am
I just out of luck?

Is there another way (using VBA perhaps) to maybe feed the url addresses to
some system command, for example, launch IE and provide the url address?

Thanks for any responses.
 
J

Jake Marx

Hi Bruce,

In my experience, the UI limits you to about 256 characters for a URL.
However, I was able to add a longer URL via the Hyperlinks.Add method:

Sheet1.Hyperlinks.Add Range("A2"), "<longURLHere>"

An alternative would be to use the FollowHyperlink method to launch IE and
follow a hyperlink. Or you could trap the Worksheet_FollowHyperlink event
by setting up the hyperlink to go nowhere (ie, go to the same cell it's in),
look up the URL via a hidden worksheet or similar method, then use the
FollowHyperlink method (or automate IE) to launch the web browser and go to
the desired URL.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]
 
N

NickHK

Bruce,
Not sure if it works for HyperLinks, but to get around the limit for
..FormulaArray, you can insert some of you string, with a #place holder#. The
replace the #place holder# with the remainder of the text.

NickHK
 
G

Guest

Thanks, Jake. When I tried adding the links with VBA, I must have been doing
something wrong. It's working for me now. Thanks for your suggestions.
--
Bruce J. Baumann


Jake Marx said:
Hi Bruce,

In my experience, the UI limits you to about 256 characters for a URL.
However, I was able to add a longer URL via the Hyperlinks.Add method:

Sheet1.Hyperlinks.Add Range("A2"), "<longURLHere>"

An alternative would be to use the FollowHyperlink method to launch IE and
follow a hyperlink. Or you could trap the Worksheet_FollowHyperlink event
by setting up the hyperlink to go nowhere (ie, go to the same cell it's in),
look up the URL via a hidden worksheet or similar method, then use the
FollowHyperlink method (or automate IE) to launch the web browser and go to
the desired URL.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

I'm trying to add some rather lengthy hyperlinks, and I'm coming
across an apparent length restriction. The URLs I'm trying to add
often include some query-looking stuff that looks like ASP (I'm not
familiar with ASP). For example,
"http://www.someplace.com/AllItems.aspx?RootFolder=/blahblahblah...".
It looks like the address gets truncated after 256 characters. I've
tried the HYPERLINK() function, the Insert>Hyperlink menu item, as
well as adding hyperlinks with VBA, but I get the same result. Am I
missing something, or am I just out of luck?

Is there another way (using VBA perhaps) to maybe feed the url
addresses to some system command, for example, launch IE and provide
the url address?

Thanks for any responses.
 

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