Excel Mail



I’m working with Excel sheets that contain a lot of email addresses as well.

  1. Excel Mail Merge Labels
  2. Excel Mail Merge Instructions
  3. Excel Mail Log
  4. Excel Mailing Labels
  5. Excel Mailto

When updating a field, it turns the email address in a clickable “mailto” link and when I’m not careful when clicking, it opens up a new email in Outlook.

As I have no intention to email anyone directly from these lists, but do work a lot with these sheets, this is getting annoying quite fast.

Is there any way to disable this behavior in Excel?

The automatic conversion of typed email address into clickable mailto links in Excel is controlled by the same AutoCorrect option that turns typed internet addresses (URLs) into clickable hyperlinks.

I Don't Use “Send as Attachment” Excel has a built-in feature called Send as Attachment that will. The Excel spreadsheet to be used in the mail merge is stored on your local machine. Changes or additions to your spreadsheet are completed before it's connected to your mail merge document in Word.

If you actually need to work with the data rather than to follow links, you can turns this function off or use an alternative clicking/selection method for cells that contain hyperlinks.

In VBA to Send Email from Excel we can automate our mailing feature so that we can automatically send emails to multiple users at a time, to do so we need to remember that it is done by outlook another product of outlook so we need to enable outlook scripting in VBA to do so and once it is done we use.Application method to use outlook features. Mail from Excel with Outlook (Windows) Outlook object model (attachment) Mail the whole workbook. Mail more then one sheet. Mail Range or Selection. Mail every worksheet. Outlook object model (body) Other tips. An Excel mailing list can be shared with Outlook for contact management and email blasts, while the same list can merge with Word to create form letters or address and filing labels. To ensure the most flexible use of your Excel list, keep in mind a few best practices. Creating Your Excel Mailing List Step 1.

Disable automatic hyperlink feature

To disable the automatic hyperlink feature in Excel choose;

  • File-> Options-> Proofing-> AutoCorrect Options…-> AutoFormat As You Type-> uncheck: Internet and network paths with hyperlinks

Note: If this option is left enabled and AutoCorrect changes the address into a hyperlink, you can press CTRL+Z to directly undo the change.


AutoFormat can recognize email address and convert them to Mailto links.

Alternative clicking or selection method

If you don’t want to turn of the feature (for instance when the recipient of the Excel sheet needs to be able to click on the links), you can also use one of the following alternative clicking or selection methods;

  • Click and hold down the mouse button bit longer on the hyperlink. This will select the cell instead of activate the hyperlink.
  • Make the column a bit wider so there is white space within the cell so you can click or double click there without activating the hyperlink.
  • Click in a nearby cell that doesn’t have a hyperlink and use the arrow keys on your keyboard to select the hyperlinked cell. You can then press F2 to edit the contents.

Introduction

I enjoy hearing from readers that have used concepts from this blog to solve their own problems.It always amazes me when I see examples where only a few lines of python code can solvea real business problem and save organizations a lot of time and money. I am also impressedwhen people figure out how to do this with no formal training - just with some hard work andwillingness to persevere through the learning curve.

This example comes from Mark Doll. I’ll turn it over to him to give his background:

I have been learning/using Python for about 3 years to help automate business processesand reporting. I’ve never had any formal training in Python, but found it to be a reliabletool that has helped me in my work.

Read on for more details on how Mark used Python to automate a very manual process of collecting andsorting Excel files to email to 100’s of users.

Mail

The Problem

Here’s Mark’s overview of the problem:

A business need arose to send out emails with Excel attachments to a list of~500 users and presented us with a large task to complete manually. Making this task harderwas the fact that we had to split data up by user from a master Excel file to create theirown specific file, then email that file out to the correct user.

Imagine the time it would take to manually filter, cut and paste the data into a file,then save it and email it out - 500 times! Using this Python approach we were able toautomate the entire process and save valuable time.

I have seen this type of problem multiple times in my experience. If you don’t have experiencewith a programming language, then it can seem daunting. With Python, it’s very feasible toautomate this tedious process. Here’s a graphical view of what Mark was able to do:

Solving the Problem

The first step is getting the imports in place:

Excel Mail Merge Labels

Now we will set up some strings with the current date and our directory structure:

Let’s take a look at the data file we need to process:

The next step is to group all of the CUSTOMER_ID transactions together. We start bydoing a groupby on CUSTOMER_ID.

It might not be apparent to you what customer_group is in this case.A loop shows how we can process this grouped object:

Here’s the last group_df that shows all of the transactions for customer A1005:

We have everything we need to create an Excel file for each customer and store in a directoryfor future use:

The attachments list contains the customer ID and the full path to the file:

To make the processing easier, we convert the list to a DataFrame:

The final data prep stage is to generate a list of files with their email addresses bymerging the DataFrames together:

Excel Mail Merge Instructions

Which gives this simple DataFrame:

Excel Mail Log

We’ve gathered the list of customers, their emails and the attachments. Now we need to sendan email with Outlook. Refer to this article for additional explanation of this code:

Excel mailto

Excel Mailing Labels

We can use this simple class to generate the emails and attach the Excel file.

The last step is to move the files to our archive directory:

Excel Mailto

Mail

Summary

This example does a nice job of automating a highly manual process where someonelikely did a lot of copying and pasting and manual file manipulation. I hope the solution thatMark developed can help you figure out how to automate some of the more painful parts ofyour job.

I encourage you to use this example to identify similar challenges in your day to day work.Maybe you don’t have to work with 100’s of files but you might have a manual process yourun once a week. Even if that process only takes 1 hour, use that as a jumping off point tofigure out how to use Python to make it easier. There is no better way to learn Pythonthan to apply it to one of your own problems.

Thanks again to Mark for taking the time to walk us through this content example!

Comments