Results 1 to 4 of 4

Adding a Link to another spreadsheet in email body using VBA

Threaded View

  1. #1
    Registered User
    Join Date
    04-08-2024
    Location
    Glasgow
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20178) 64-bit
    Posts
    2

    Post Adding a Link to another spreadsheet in email body using VBA

    Good morning,

    I have VBA coding that sends an email to a specific person depending on what name is entered into a form.
    I want to be able to add a link within the email that will take the recipient to a specific spreadsheet, the link is different for each person,. The link to be placed in the text body comes from cell AM22.

    I have the following code, it sends everything that i need it to apart from a workable link, currently it is just populating the text from AM22 (not showing as a link)
    Sub email_from_excel_basic()
    
    Dim emailapplication As Object
    Dim emailitem As Object
    Dim link As String
    
    Set emailapplication = CreateObject("Outlook.Application")
    Set emailitem = emailapplication.createitem(0)
    
    ' build the email
    
    emailitem.to = Range("Handover!D9").Value
    emailitem.Subject = "Handover Created."
    emailitem.Body = "Handover created to carry out the following:" & vbNewLine & vbNewLine & Range("Handover!AL17").Value & "    " & Range("Handover!AM17").Value & vbNewLine & Range("Handover!AL18").Value & "  " & Range("Handover!AM18").Value & vbNewLine & Range("Handover!AL19").Value & "  " & Range("Handover!AM19").Value & vbNewLine & Range("Handover!AL20").Value & "  " & Range("Handover!AM20").Value & vbNewLine & Range("Handover!AL21").Value & "  " & Range("Handover!AM21").Value & vbNewLine & Range("Handover!AL22").Value & "  " & Range("Handover!AM22").Value
    
    ' send the email
    emailitem.send
    
    Set emailitem = Nothing
    Set emailapplication = Nothing
    
    End Sub
    Administrator's note: Please take the time to review our rules. There aren't many, and they are all important. Our guidelines recommend code tags. I have added them for you this time because you are a new member. --6StringJazzer

    Very new to VBA and any guidance would be greatly appreciated.

    Scott
    Last edited by 6StringJazzer; 04-08-2024 at 07:18 AM. Reason: please use code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Insert live link to within lotus notes email body
    By originalJ in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-16-2015, 09:15 PM
  2. [SOLVED] how to link textbox message as email body using excel VBA code
    By yogi_himalayan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-01-2014, 08:40 PM
  3. Adding to body in email
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-24-2013, 03:09 PM
  4. copy from spreadsheet to the body of an email
    By csdk1207 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2013, 09:36 AM
  5. Clickable link to file in CDO Email body
    By cschoyer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2012, 02:11 PM
  6. Excel code to email whats in the spreadsheet in the body of email
    By Kain93 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2012, 09:55 AM
  7. Putting a clickable link in the body of email sent from Excel
    By raehippychick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2008, 06:04 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1