B
Bill
Didn't see another thread getting this specific, so here goes ...
We are trying to use VB to add hyperlinks and subsequently get the
address of existing hyperlinks. Adding works fine. Getting the Name
and/or Address property doesn't, at least in Office:Mac.
'this works
Sub AddLink()
ActiveSheet.Hyperlinks.Add Anchor:=ActiveSheet.Range("A4"), _
Address:="http://www.apple.com/"
End Sub
'this returns an empty string on Mac, yet works properly on a
WinXP/OfficeXP machine
' the Name property also fails, even following an example in the help
files using Name
Sub GetLink()
ActiveSheet.Range("B4").Formula =
ActiveSheet.Hyperlinks(1).Address
End Sub
'As a work-around, we tested to see if a manually entered ScreenTip
would be returned.
Sub GetLinkScreenTip() 'this works
ActiveSheet.Range("B4").Formula =
ActiveSheet.Hyperlinks(1).ScreenTip
End Sub
'that works ... so lets just add the following to the AddLink
procedure and we should
' be able to extract the link from the ScreenTip instead of the Name
or Address properties
ActiveSheet.Hyperlinks(1).ScreenTip = "http://www.apple.com/"
'or just append to the Add method
This results in the following error:
Run-time error '7'; Out of Memory
Anyone have a clue? We want this automated as part of our workflow
because there will be lots of links. We're using hyperlinks to PDFs
in a subfolder, not web page links, but that shouldn't affect this.
Thanks in advance.
We are trying to use VB to add hyperlinks and subsequently get the
address of existing hyperlinks. Adding works fine. Getting the Name
and/or Address property doesn't, at least in Office:Mac.
'this works
Sub AddLink()
ActiveSheet.Hyperlinks.Add Anchor:=ActiveSheet.Range("A4"), _
Address:="http://www.apple.com/"
End Sub
'this returns an empty string on Mac, yet works properly on a
WinXP/OfficeXP machine
' the Name property also fails, even following an example in the help
files using Name
Sub GetLink()
ActiveSheet.Range("B4").Formula =
ActiveSheet.Hyperlinks(1).Address
End Sub
'As a work-around, we tested to see if a manually entered ScreenTip
would be returned.
Sub GetLinkScreenTip() 'this works
ActiveSheet.Range("B4").Formula =
ActiveSheet.Hyperlinks(1).ScreenTip
End Sub
'that works ... so lets just add the following to the AddLink
procedure and we should
' be able to extract the link from the ScreenTip instead of the Name
or Address properties
ActiveSheet.Hyperlinks(1).ScreenTip = "http://www.apple.com/"
'or just append to the Add method
This results in the following error:
Run-time error '7'; Out of Memory
Anyone have a clue? We want this automated as part of our workflow
because there will be lots of links. We're using hyperlinks to PDFs
in a subfolder, not web page links, but that shouldn't affect this.
Thanks in advance.