Live email address from VB6 to Excel

Posted on 2012-09-03
Last Modified: 2012-09-03
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.
Question by:NormaPosy
    LVL 10

    Accepted Solution

    The Address of the hyperlink has to begin with "mailto:":
        Address:="mailto:" & Selection.Value

    Author Closing Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
    When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
    This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
    This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now