VBA for mailto hyperlink that exceeds 255 characters:

SevenOut

Board Regular
Joined
Jan 7, 2020
Messages
82
Office Version
  1. 2013
Platform
  1. Windows
I'm struggling with finding a solution with the hyperlink formula for sending email to multiple recipients (with a subject) when the combined total characters of all recipients exceeds 255.
Similar questions have popped up online with a few vba workarounds but tuning the script to match my situation has not gone well.

From the "Email" worksheet, A1:A50 are recipient names (not important to the task, at least I don't think). B is blank for austhetic spacing while C1:C50 are the email addresses that correspond to each name. Each email address ends with a ; for convenience of the formula.
My non-vba approach so far has been the hyperlink formula; =hyperlink("mailto:"&C1&C2&C8&C9&"?subject="&"Report","Send Report")... This has worked until the combination of email recipients exceeds 255 characters for what excel sees in the hyperlink formula. The formula, when working correctly, creates a clickable hyperlink "Send Report", when clicked my email client's new email window pops up with the email recipients populated and the subject reads "Report".

What I've found online searching through similar questions, there is an email body included which i do not need. In these cases, it appears the contents of the email body are what is pushing them over 255. Not my case however and adapting those scripts have not gone well.

Any help would be appreciated. Below is a sample workbook.
Sample.xlsm
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I've achieved a basic solution with:
VBA Code:
Sub TokesHyperlink()
  ActiveSheet.Hyperlinks.Add Range("E22"), Address:="Email!E32", TextToDisplay:="Send Tokes"
End Sub

What works and what does not:
Address:="Email!E32" - I was hoping this would reference the address info stored on worksheet "Email" E32. This does not however.
If I copy the info from Email!E32 and paste it to Address:"" then it works fine.
Could someone point me in the right direction to pull the address from the info stored on another worksheet? In this case, Email!E32
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top