F
FUBARinSFO
Hi:
I've got hyperlink formulas in my worksheet of the following form:
=HYPERLINK("filename.htm", "displaytext")
1. When I try to count the number of hyperlinks in a cell containing
this formula, it gives me zero (0) hyperlinks:
MsgBox ActiveCell.Hyperlinks.Count
2. When I try to assign the hyperlink to a string value, it gives me
"display" instead of "filename.htm":
Dim myLink As String
myLink = ActiveCell.Value
3. When I try to Dim myLink as Hyperlink, I get a zero count of
hyperlinks, and an Error 91, 'Object variable ... not set'
Dim myLink As Hyperlink
myLink = ActiveCell.Value
4. When I use literal hyperlinks in the cell, as opposed to formulas,
and defind myLink as a string, I can work with both literal strings
and with manually-entered hyperlinks in the below code:
Dim myLink As String
' Dim myLink As Hyperlink
MsgBox ActiveCell.Hyperlinks.Count
If ActiveCell.Hyperlinks.Count > 0 Then
myLink = ActiveCell.Hyperlinks(1).Address
Else
myLink = ActiveCell.Value
End If
ThisWorkbook.FollowHyperlink myLink
Any help with using the HYPERLINK() formula instead of literal
hyperlinks would be greatly appreciated.
-- Roy Zider
I've got hyperlink formulas in my worksheet of the following form:
=HYPERLINK("filename.htm", "displaytext")
1. When I try to count the number of hyperlinks in a cell containing
this formula, it gives me zero (0) hyperlinks:
MsgBox ActiveCell.Hyperlinks.Count
2. When I try to assign the hyperlink to a string value, it gives me
"display" instead of "filename.htm":
Dim myLink As String
myLink = ActiveCell.Value
3. When I try to Dim myLink as Hyperlink, I get a zero count of
hyperlinks, and an Error 91, 'Object variable ... not set'
Dim myLink As Hyperlink
myLink = ActiveCell.Value
4. When I use literal hyperlinks in the cell, as opposed to formulas,
and defind myLink as a string, I can work with both literal strings
and with manually-entered hyperlinks in the below code:
Dim myLink As String
' Dim myLink As Hyperlink
MsgBox ActiveCell.Hyperlinks.Count
If ActiveCell.Hyperlinks.Count > 0 Then
myLink = ActiveCell.Hyperlinks(1).Address
Else
myLink = ActiveCell.Value
End If
ThisWorkbook.FollowHyperlink myLink
Any help with using the HYPERLINK() formula instead of literal
hyperlinks would be greatly appreciated.
-- Roy Zider