+ Reply to Thread
Results 1 to 4 of 4

Adding a Link to another spreadsheet in email body using VBA

  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)
    Please Login or Register  to view this content.
    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

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2407
    Posts
    25,974

    Re: Adding a Link to another spreadsheet in email body using VBA

    To include a link in an email, you have to use HTMLbody instead of Body, and write the content in HTML. You did not give us enough information to know where the file is to be able to link to it.

    An HTML link cannot link to a specific worksheet or cell in an Excel file. You can do this internal to an Excel file with a hyperlink in a cell, but not from a link in an email. The best you can do is link to the file and Excel will open it.

    There is the other question of where the file is stored and whether an email can even link to it at all.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2407
    Posts
    25,974

    Re: Adding a Link to another spreadsheet in email body using VBA

    I am reading your post again and I may have misunderstood. You don't want to link to cell AM22; the content of cell AM22 gives you the link. Here is how I would write this, also splitting up the line for readability:

    Please Login or Register  to view this content.
    Impossible to test without your file.

  4. #4
    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

    Re: Adding a Link to another spreadsheet in email body using VBA

    Thank you very much, i will give that a try.

+ Reply to Thread

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