• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Inserting a hyperlink into outlook , hyperlink needs to be the path of the excel spreadsheet|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Inserting a hyperlink into outlook , hyperlink needs to be the path of the excel spreadsheet|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosInserting a hyperlink into outlook …
sp_PrintTopic sp_TopicIcon
Inserting a hyperlink into outlook , hyperlink needs to be the path of the excel spreadsheet
Avatar
richard hayward
Member
Members
Level 0
Forum Posts: 11
Member Since:
February 8, 2019
sp_UserOfflineSmall Offline
1
July 30, 2021 - 5:23 pm
sp_Permalink sp_Print

Hi 

 

This is a follow on from a previous question, I have a piece of code that once a button is pressed sends an email to recipients with a hyperlink in the body of the mail which takes them to that excel document

 

So the bit I am having trouble with is the following code

 

mbody = "Hello" & vbNewLine & _
"We have a new MDF Brief In, The Project Leaders Section is complete" & vbNewLine & _
"NPD is first in the flow so please complete your section" & vbNewLine & _
"You can access the File here" & """<https://gbconnect.sharepoint.c...../MAIDSTONE COMPLETED MDF FORMS 2021/""" & ActiveWorkbook.Name

simply the ActiveWorkbook.name (The filename of the spreadsheet) is not included in the hyperlink and it needs to be

 

Can somebody help me with this please

 

Thank you in advance

sp_AnswersTopicSeeAnswer See Answer
Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1824
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
July 30, 2021 - 8:22 pm
sp_Permalink sp_Print sp_EditHistory

A link in html looks like this:

 

&lt;a href="https://www.site.com/"&gt;click here&lt;/a&gt;

"You can access the File here: " &amp; "&lt;a href=""https://gbconnect.sharepoint.com/sites/BUKGBGATEPROCESS/MDF/MAIDSTONE COMPLETED MDF FORMS 2021/" &amp; ActiveWorkbook.Name &amp; """" &amp; "&gt;ActiveWorkbook.Name&lt;/a&gt;"

Replace &amp; with &

Replace &gt; with >

Replace &lt; with <

1-3.jpgImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage 1-3.jpg (11 KB)
Avatar
richard hayward
Member
Members
Level 0
Forum Posts: 11
Member Since:
February 8, 2019
sp_UserOfflineSmall Offline
3
July 30, 2021 - 9:16 pm
sp_Permalink sp_Print

Hi Catalin,

 

Thank you for your response. Now the code looks like this :-

"You can access the File here: " & " <a href=""https://gbconnect.sharepoint.com/sites/BUKGBGATEPROCESS/MDF/MAIDSTONE COMPLETED MDF FORMS 2021/" & ActiveWorkbook.Name & """" & ">" & ActiveWorkbook.Name & "</a>"

 

And the outlook looks like this:-

Hello
We have a new MDF Brief In, The Project Leaders Section is complete
NPD is first in the flow so please complete your section
You can access the File here:  <a href="https://gbconnect.sharepoint.c...../MAIDSTONE COMPLETED MDF FORMS 2021/MDF MASTER FORM - MAIDSTONE V20.xlsm">MDF MASTER FORM - MAIDSTONE V20.xlsm</a>

So only some of the hyperlink worked and we have the coding in amongst the hyperlink
 
 
As you can see, unfortunately that did not work. To be honest I had tried the a href, without success prior.

 

This is giving me a real headache, any other solutions / Comments

 

Thank you so much

 

Kind Regards

 

Richard 

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1824
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
4
July 31, 2021 - 1:03 am
sp_Permalink sp_Print

You are not providing the code you are using so it's hard to see what you are doing.
Are you using .HTMLBody?

If you use .Body instead of .HTMLBody, this will not work.

sp_AnswersTopicAnswer
Answers Post
Avatar
richard hayward
Member
Members
Level 0
Forum Posts: 11
Member Since:
February 8, 2019
sp_UserOfflineSmall Offline
5
August 2, 2021 - 4:07 pm
sp_Permalink sp_Print sp_EditHistory

Hi Catalin,

 

I was using .body not .htmlbody, the link appears in the email perfectly now, however when I tried to open the file from the  email, it opens ok right up until I click "edit workbook" , then  I got an error "unknown error trying to lock file", which after sending to several people turned out to be because it was opening the file in IE instead of Chrome (Useful tip for others there!), anyway it all works perfectly now.

Thank you very much for your help 

Kind Regards

 

Richard

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Sherry Fox, Cassie Bernier
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 215
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Abisola Ogundele
MARTYN STERRY
Rahim Lakhani
Ngoc Qui Nguyen
Clement Mansfield
Rose .
Bindu Menon
Baruch Zemer
Purple RainbowBenefactor
MOTH Junkie
Forum Stats:
Groups: 3
Forums: 24
Topics: 6350
Posts: 27773

 

Member Stats:
Guest Posters: 49
Members: 32317
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.