Send an Outlook Email with a Cell Hyperlink Using Excel VBA
Question details
Create an Outlook email from Excel VBA with a clickable link read from a worksheet cell instead of a file attachment.

- Product
- Microsoft Excel and Outlook
- Device & OS
- not provided
- Scenario
- Reuse an Excel macro to email links to different files by changing a cell value.
- Observed behavior
- The email body contains a clickable hyperlink to the file, without attaching the file itself.
Place an accessible file or web link in cell B2 of the worksheet you want to use. The example uses Outlook automation and requires desktop Excel and a compatible installed version of Outlook, such as classic Outlook for Windows.
Read a worksheet link and add it to an Outlook HTML email
Use this approach to change the destination by editing cell B2 rather than changing the macro.
In Excel, select the worksheet you want to use and enter the destination URL in cell B2. An HTTPS sharing link is preferable when available.
Press Alt+F11, select Insert > Module, and paste this macro: Sub EmailCellLink() Dim outlookApp As Object Dim msg As Object Dim link As String link = CStr(ActiveSheet.Range("B2").Value) If Len(Trim$(link)) = 0 Then MsgBox "Enter a link in cell B2." Exit Sub End If link = Replace(link, "&", "&") link = Replace(link, Chr$(34), """) link = Replace(link, "<", "<") link = Replace(link, ">", ">") Set outlookApp = CreateObject("Outlook.Application") Set msg = outlookApp.CreateItem(0) With msg .Subject = "File link" .HTMLBody = "<p>Please open the file:</p><p><a href=" & Chr$(34) & link & Chr$(34) & ">Open file</a></p>" .Display End With End Sub
Return to the worksheet containing B2, press Alt+F8, select EmailCellLink, and click Run. In the Outlook draft, add recipients, review the link, and click Send.

Manage spreadsheets and file links with WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface and Microsoft Office format support, making it easy to move existing spreadsheets into WPS. Outlook automation is a Microsoft Office-specific task and is not fixed by switching to WPS.

Frequently Asked Questions
How do I use a different cell for the link?
In the VBA editor, change ActiveSheet.Range("B2") to the cell you want, such as ActiveSheet.Range("C2"). Select the relevant worksheet before running the macro.
Does the link have to start with HTTPS?
No. A file link can work if it points to a valid shared location that the recipient can access, but email clients or security policies may block it. Use an HTTPS sharing link when available.
Why can't the recipient open the linked file?
Check the sharing settings for the file or server location and confirm that the recipient has permission and network access. Also check whether their email client blocks file links.
Does the macro send the email automatically?
No. The example uses .Display to open a draft in Outlook. Add recipients and click Send after reviewing the message.




