*Watch this video next* STOP Wasting Time on Repetitive Tasks with Excel VBA go.launchexcel.com/macros-vba-school-vsl-youtube *Download the Free Excel Workbook* Step 1: Sign up for free: go.launchexcel.com/email-signup-youtube Step 2: Log in here: courses.launchexcel.com/dashboard/en/login Step 3: Download: courses.launchexcel.com/school/course/workbook-downloads/lecture/5074882#headline-c2402612 And you can stay logged in for quick access to future workbook downloads. *Click here for the article with full VBA code:* www.launchexcel.com/send-outlook-emails-with-excel-vba-7-levels *Chapters:* 00:00 Do you want to send multiple emails from Excel? 00:24 LEVEL 1: Create email (formula) 04:12 LEVEL 2: Send multiple emails (VBA) 08:26 ↳ Outline code 09:16 ↳ Save as .XLSM 09:50 ↳ Walkthrough 11:43 ↳ Creating emails with For Loop 13:46 ↳ Body text 14:30 ↳ Assign VBA macro to button 15:25 LEVEL 3: Single attachment (VBA) 18:23 LEVEL 4: Multiple attachments (VBA) 22:51 LEVEL 5: Single attachment picker (VBA) 26:03 LEVEL 6: Multi attachments picker (VBA) 31:11 LEVEL 7: Include Excel range as table (VBA) 32:46 ↳ Diagram of VBA code 34:37 ↳ Walkthrough with Excel 35:48 Learn Excel VBA 10x Faster
@debbie60853 күн бұрын
Thank you for the great video. It was really clear and helpful.
@launchexcel2 күн бұрын
Glad you found it clear and helpful, Debbie.
@AlesKus4 күн бұрын
This is just amazing! Your tutorials are fantastic and I am watching them like great action movie :-)
@launchexcel4 күн бұрын
🕵️♂️ Your mission, should you choose to accept it, is to watch all of the videos on Launch Excel and tell us tip is your ultimate favorite. The fate of your Excel skills may depend on it! This message will self-destruct in 5 seconds… just kidding 😉🔥.
@entrustedhub5 күн бұрын
This is great, Thank Vic
@launchexcel2 күн бұрын
Sure! Happy to help 😀
@kiranarana72745 күн бұрын
Well done
@launchexcel2 күн бұрын
Thank you 🙏
@TrevMA5 күн бұрын
Nice! I'm only three minutes in, and you've given me some great ideas for some quick custom lambda functions to avoid having to manually build the formula string for Level 1. Curious to see how you've implemented Levels 2-7 in VBA.
@launchexcel2 күн бұрын
That's great! If you want to share your lambdas here, that would be awesome. 🤩
@TrevMA2 күн бұрын
@@launchexcel Unfortunately I found that the HYPERLINK function seemingly can't be used in LAMBDA statements, so you can't directly create the link. However, you can build the URL using this function, which I named "buildEmailURL": =LAMBDA(recipient_email,[subject],[cc],[bcc],[body], LET(joinEmails, LAMBDA(emails, TEXTJOIN("; ", TRUE, emails)), buildParameterString, LAMBDA(parameter,[value],[may_be_array], IF(NOT(ISOMITTED(value)), parameter & "=" & IF(may_be_array, joinEmails(value), value), "")), substituteLineBreaks, LAMBDA(text, SUBSTITUTE(text, CHAR(10), "%0D%0A")), base_string, "mailto:" & joinEmails(recipient_email), subject_string, buildParameterString("subject", subject), cc_string, buildParameterString("cc", cc, TRUE), bcc_string, buildParameterString("bcc", bcc, TRUE), body_string, buildParameterString("body", substituteLineBreaks(body)), parameter_string, TEXTJOIN("&", TRUE, subject_string, cc_string, bcc_string, body_string), mailto_url, TEXTJOIN("?", TRUE, base_string, parameter_string), mailto_url)) So that should be able to take either a single email or an array of emails for recipient_email, cc, and bcc. It should also automatically handle line breaks in the email body. You can then create the link directly as, e.g.: =HYPERLINK(buildEmailURL("example@email.com", "Example subject", {"cc_array_example@gmail.com", "cc_array_example2@gmail.com"}, , "This is an example email!"), "Display text"), Or alternatively you could have the buildEmailURL(...) statement in a separate cell that you can then reference. I still haven't had a chance to delve too deeply into the VBA side of things, but I'll be curious to see how I can integrate it.
@TrevMA2 күн бұрын
@@launchexcel Unfortunately I found that HYPERLINK seemingly can't be used in LAMBDA statements, but the following function (which I named "buildEmailURL") can be used to create the mailto URL: =LAMBDA(recipient_email,[subject],[cc],[bcc],[body], LET(joinEmails, LAMBDA(emails, TEXTJOIN("; ", TRUE, emails)), buildParameterString, LAMBDA(parameter,[value],[may_be_array], IF(NOT(ISOMITTED(value)), parameter & "=" & IF(may_be_array, joinEmails(value), value), "")), substituteLineBreaks, LAMBDA(text, SUBSTITUTE(text, CHAR(10), "%0D%0A")), base_string, "mailto:" & joinEmails(recipient_email), subject_string, buildParameterString("subject", subject), cc_string, buildParameterString("cc", cc, TRUE), bcc_string, buildParameterString("bcc", bcc, TRUE), body_string, buildParameterString("body", substituteLineBreaks(body)), parameter_string, TEXTJOIN("&", TRUE, subject_string, cc_string, bcc_string, body_string), mailto_string, TEXTJOIN("?", TRUE, base_string, parameter_string), mailto_string)) It can take either a single address or an array of addresses for recipient_email, cc, and bcc, and it should handle line breaks in the email body as well. I'm still considering how I might extend it or integrate it with VBA, but that'll be outside of working hours. 😅 Hopefully people find it useful!
@robbe582 күн бұрын
Regarding this video 'a genuinely nice, helpful, and understandable one', I had a flash idea (inspiration). Should it be possible to use the CAMERA tool to copy the attached range of data instead of using all these extra functions? They may become unnecessary. I haven't tried it myself yet. You may want to figure it out because your VBA skills are much better than mine. Good luck.
@launchexcel2 күн бұрын
Great thinking! Using the CAMERA tool could indeed simplify things by skipping the extra formatting functions and directly copying the range as an image. The biggest advantage would be versatility. It captures everything in the range: charts, images, and formatting. But the downside could be that the emailed range cannot be as easily copied for other uses. That said, with OCR tools being so powerful now, I guess it doesn't make too much difference. I'll add that to my list of things to possibly try.
@abibeniam84254 күн бұрын
can you more than one email to in each of the to and cc field
@launchexcel2 күн бұрын
Yes, you can add more than one email address in the To and CC fields. ➡️ Simply separate the email addresses with a semicolon (;). For example: user1@example.com; user2@example.com. This applies to the To, CC, and BCC fields in the VBA code.
@e.o.84703 күн бұрын
Will it work if we use Automate Scripts instead of VBA codes ?
@launchexcel2 күн бұрын
I don't use Power Automate, but I found this video which you might want to check out: kzbin.info/www/bejne/hamlnKV5adJ7p5Y
@e.o.8470Күн бұрын
@@launchexcel Thank you for sharing your powerful VBA codes. They make tedious tasks much easier. One question: How can I specify the sending email account when I have multiple accounts in Outlook?
@only_office_skills4 күн бұрын
Does this works on excel 2019?
@launchexcel2 күн бұрын
Yes it should work on Excel 2019. VBA is backwards compatible.
@only_office_skillsКүн бұрын
@launchexcel Okie chan could you bring for automate data cleaning and formatting using VBA 🥳
@Prafful0002 күн бұрын
I tried the level 1 formula and it didn't work. Please assist.
@launchexcel2 күн бұрын
What problem did you encounter with the Level 1 formula?
@Prafful0002 күн бұрын
@launchexcel #VALUE. Tried checking syntax in chatgpt and found the syntax was fine but excel wasn't doing what it was supposed to do.
@Prafful0002 күн бұрын
@launchexcel #VALUE. Tried checking the syntax in chatgpt and found it was fine but still Excel didn't do what it was supposed to do.
@launchexcelКүн бұрын
Which version of Excel are you using? And have you tried a simple mailto with just the To field, and see if that works?
@Prafful000Күн бұрын
@@launchexcel I am using Excel 365 and have tried using just To field and it works. But when I add all the other fields (except bcc) it doesn't work. Can you give me the syntax once again which contains To, CC, Subject and body of the email (text followed by a table) Please.
@GETT-cj2xj5 күн бұрын
it launches a setup for outlook whick BTW is already set up on my pc but I cant set it up
@launchexcel2 күн бұрын
Hmm, that's a tough one. 🤨 It sounds like maybe the code is trying to access Outlook but can't find a valid default profile or active session. Here are a few steps you can try to resolve this: ↳ Make sure you have a default Outlook profile set up. Go to Control Panel > Mail > Show Profiles and confirm a profile is selected as default. ↳ Try opening Outlook manually before running the macro to ensure it’s already active. ↳ If you’re running different bit versions of Excel and Outlook (e.g., 32-bit Excel with 64-bit Outlook), this might cause issues. Check and align them if possible. ↳ If nothing works, try repairing your Office installation via the Microsoft 365 setup tool. Let me know if this helps!