Can anyone tell me what needs to be done to this line in order to mail the active worksheet as a hyperlink instead of sending the whole file?
ActiveWorkbook.SendMail Recipients:=”Mr Recipient”, Subject:=(“ABC.xls @ ” & Now())
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Sending hyperlink via e-mail (Excel ’97)
Sorry, wrong teminology. What I meant was to send a shortcut in a mail pointing the user to the original file which is saved on a network volume. I can’t run the risk of someone saving the sent workbook to their C: drive, editing it and then saving it to the network and knocking out any changes anyone else may have made.
Thanks, Andrew.
Marc,
Sorry for the delay in responding – did not catch your last response earlier.
If Outlook is you email client, the following code will include a link to the activeworkbook in the message body text. It will require that you set a reference to Outlook in your VBA references, and probably the Microsoft Scripting Runtime Library, as I have used that to get the short path/file name as the Long name does not seem to translate to a hyperlink if the pathname includes spaces.
Sub SendFileLink() Dim strLink As String Dim objOL As New Outlook.Application Dim objMail As MailItem Dim objFSO As Scripting.FileSystemObject Dim objFile As Scripting.File Set objFSO = New Scripting.FileSystemObject Set objFile = objFSO.GetFile(ActiveWorkbook.FullName) strLink = "file://" & objFile.ShortPath Set objOL = New Outlook.Application Set objMail = objOL.CreateItem(olMailItem) With objMail .To = "Recipient1;Recipient2" .Subject = "File Link" .Body = strLink & vbCrLf & vbCrLf & "Message" .Send End With objOL.Quit Set objMail = Nothing Set objOL = Nothing Set objFile = Nothing Set objFSO = Nothing End Sub
You can try first by remarking out the red lines and changing the line in blue to
strLink = "file://" & ActiveWorkbook.FullName
as it may work on your system, especially if you do not have spaces in your path name.
Hope that is what you are looking for.
Andrew C
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications