• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Live email address from VB6 to Excel

My VB6 application creates an Excel spreadsheet.
Column H contains email addresses.
The cells in column H already contain the string texts of the addresses
(starting at row 5)
when the following is executed:

sCol = "H"
For iI = 1 To iMaxItems
   sRow = CStr(iI + 4)
   sRange = sCol & sRow
   .ActiveSheet.Hyperlinks.Add Anchor:=.Selection, _
Next iI

Open in new window

The spreadsheet is created all right, and all the email addresses are blue and underlined.
But when I click on one of them, I get:
"Cannot open specified file".

By the way, if it matters: Each cell entry is an address followed by a comma.
Because eventually the intention is to select a group to email.
1 Solution
The Address of the hyperlink has to begin with "mailto:":
    Address:="mailto:" & Selection.Value
NormaPosyPhysicistAuthor Commented:
Thank you.

I discovered that building the prefix "mailto:" into the email address data is the wrong way to do it. The whole thing shows up in the spreadsheet cell.

It has to be done at the Address:= as you indicate.

I now have a related question, but I will post it here as a new question.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now