Hyperlinks from Excel

B

Bernd

Dear all

I'm using Office 2003.

While importing (or pasting) data from an Excel-sheet with links,
link-addresses get lost.

Any idea how to save them?

Regards

Bernd
 
J

John Nurick

Hi Bernd,

Access hyperlink fields are just memo fields that store the hyperlink
information as text with the display text, web address and bookmark
delimited by #. The function below can be used to convert the Excel
hyperlinks into this format on the Excel sheet before importing.

Public Function ExpandHyperlink(R As Range, _
Optional AddressOnly As Boolean = False) As Variant

'Converts Excel hyperlink into a string that can be
'imported into an Access text field which can then
'be converted into a hyperlink field.

If R.Hyperlinks.Count > 0 Then
With R.Hyperlinks(1)
ExpandHyperlink = IIf(AddressOnly, .Address, _
.Name & "#" & .Address & "#" & .SubAddress)
End With
Else
ExpandHyperlink = ""
End If
End Function
 

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