Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Need help with hyperlink character limit

Is there a workaround for the 254 character limit in Excel hyperlinks?

If I use the HYPERLINK function with a 500 character URL,
(ActiveCell.FormulaR1C1 = "=HYPERLINK(RC[7],RC[1])")
all I get is #VALUE, but I have found that if I right-click on a cell and
select "Hyperlink" that I can paste the 500 character URL in the address box
and the hyperlink will work

Is there any way to accomplish this via VBA?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Need help with hyperlink character limit

Hi there,
I just tryed this and it worked on a 404 character string (a valid
url).

Sub setlink()
Dim r1 As Range
Dim r2 As Range
Set r1 = Sheet1.Range("A1")
Set r2 = Sheet1.Range("A2")
Sheet1.Hyperlinks.Add r1, r2.Value
End Sub

Kind regards,

Bernie Russell

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Need help with hyperlink character limit

This is very interesting! I tried to do something similar recently, but
couldn't get ti to work, and finally lost interest in the idea. Now, my
interest has been reset, and my expectations have been elevated. Can this be
done with a URL that is 696 characters? Here is a sample of my code (very
simple sample):

Sub setlink()
Dim r1 As Range
Dim r2 As Range
Dim r3 As Range
Set r1 = Sheet1.Range("A1")
Set r2 = Sheet1.Range("A2")
Set r3 = Sheet1.Range("A3")
Range("A6") = Sheet1.Hyperlinks.Add(r1, r2, r3.Value)
Call Macro1
End Sub

Sub Macro1()

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & Range("A6"), _
Destination:=Range("A10"))
.Name = "Main"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "12"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub

Well, that's the concept at least. I get an error on this line:
Range("A6") = Sheet1.Hyperlinks.Add(r1, r2, r3.Value)

I still can't quite get my mind around it. Can anyone see what is wrong
here? I would really love to turn this concept into a reality!!

Regards,
Ryan---




--
RyGuy


" wrote:

Hi there,
I just tryed this and it worked on a 404 character string (a valid
url).

Sub setlink()
Dim r1 As Range
Dim r2 As Range
Set r1 = Sheet1.Range("A1")
Set r2 = Sheet1.Range("A2")
Sheet1.Hyperlinks.Add r1, r2.Value
End Sub

Kind regards,

Bernie Russell


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Need help with hyperlink character limit

Thank you Bernie!!

That was exactly what I was looking for!

" wrote:

Hi there,
I just tryed this and it worked on a 404 character string (a valid
url).

Sub setlink()
Dim r1 As Range
Dim r2 As Range
Set r1 = Sheet1.Range("A1")
Set r2 = Sheet1.Range("A2")
Sheet1.Hyperlinks.Add r1, r2.Value
End Sub

Kind regards,

Bernie Russell


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
255 Character Limit Colin Excel Discussion (Misc queries) 2 March 2nd 06 07:58 PM
255 character limit Noah Excel Programming 4 February 23rd 06 03:04 PM
character limit in hyperlink function Brad B. Excel Worksheet Functions 0 December 22nd 05 11:04 PM
How can I change 255 character limit in 'hyperlink' function? Brad B. Excel Worksheet Functions 0 December 21st 05 09:03 PM
Character Limit Dylan Moran Excel Programming 5 September 9th 05 02:13 AM


All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"