So to those reading this, if you are on this sub for help, to learn, or to offer help, know this, excel got me a promotion, and it can get you one too. Thank you to everyone on this sub. Remember, keep at it, and if you too are an excel nerd, that’s awesome and keep excelling. Edit: thanks for the awards. This can often happen when an active collaborator adds filters or sorts the data in a table of a shared worksheet. Excel sheet view is a new way to create customized views to sort and filter your data without disrupting what others see. This capability is an example of customer-driven product improvement and is now available on Excel for Mac. Step 1: Set up your data source in Excel. If you're using an Excel spreadsheet as your data source for a mail merge in Word, skip this step. If the data source is a.txt or a.csv file, use the Text Import Wizard to set up your data in Excel. After you successfully import a.txt or.csv file, go to Step 2. Create zip file. If you send any file via email, it’s a good idea to compress the file before sending. You can use 7zip, which is a free file archiver. But you can also use the built-in Windows application. To compress a file right-click it and choose to Send to Compress. And you save a bit of space. Check if you have CSV files.
-->Note
Office 365 ProPlus is being renamed to Microsoft 365 Apps for enterprise. For more information about this change, read this blog post.
Symptoms
When you create a table in Microsoft Excel for Mac and copy it into a new email message in Microsoft Outlook for Mac, the table is pasted into the email without any borders.
Cause
This is a known issue in Office 2011 for Mac and Office 2016 for Mac.
Resolution
Microsoft is currently investigating this issue.
To work around this problem follow these steps:
- In Excel, select your table.
- Click the button to Apply borders to the selection.
- Select the Thick Box Border option.
- Copy and paste the table into your email message.
You can also select the Thick Box Border option before you create your table.
The table borders will be displayed as regular borders in the email when you copy it.
-->This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Summary: Microsoft Excel MVP Ron de Bruin provides several samples and a useful add-in that makes it easy for customers to send items from Excel with Outlook. From sending a workbook to sending items to multiple recipients, the code samples and add-in should become a part of your reference library. (8 printed pages)
Applies to: Microsoft Excel 2000 | Microsoft Excel 2002 | Microsoft Excel 2003 | Microsoft Excel 2007 | Microsoft Excel 2010 | Microsoft Outlook 2000 | Microsoft Outlook 2002 | Microsoft Outlook 2003 | Microsoft Outlook 2007 | Microsoft Outlook 2010
Provided by:Ron de Bruin, Microsoft Excel MVP | Frank Rice, Microsoft Corporation | About the Authors
Contents
Sending Outlook E-mail Messages from Excel
Mailing Workbooks as E-mail Attachments
Mailing Single Sheets as Attachments
Conclusion
Read Part Two: OfficeTalk: Using the Excel Object Model to Send Workbooks and Ranges through E-Mail with Outlook (Part 2 of 2)
Sending Outlook E-mail Messages from Excel
This article features code samples that you can use to perform various e-mail functions from Microsoft Office Excel by using the Microsoft Office Outlook object model. Ron de Bruin, an Excel Most Valuable Professional (MVP) and a frequent contributor to the newsgroups, provides the samples and add-in. You can find many more samples and an excellent add-in (RDBMail Add-in) that gives you several e-mail options on the Ribbon user interface (UI), at Ron’s Web site.
Sending workbooks and workbook components from Excel with Outlook is a frequently requested activity. It is relatively easy to do much of this by using commands on the Ribbon UI. However, you may want more control over what you can send. Doing this by using Microsoft Visual Basic for Applications (VBA) in Excel is where developers can make the biggest impact.
One method to use is the SendMail method in the Excel object model. This method works very well but is limited in what it can do. You can find examples using the SendMail method and a link to download a useful add-in created by Ron de Bruin in the article titled Working with Excel Workbooks and Worksheets in E-Mail.
Note
The code samples that are presented in this article will only work with Microsoft Outlook. They will not work with Microsoft Outlook Express or Microsoft Windows Mail.
You need to be aware of two security features for Outlook 2002, Outlook 2003, Outlook 2007, and Outlook 2010. Note that these features are implemented through a security update in Outlook 2000:
Blocking of a customizable list of file attachments considered unsafe because they can be used to propagate viruses.
Pop-up confirmation dialog boxes that occur when a program accesses address-related properties or attempts to send a message.
For more information about Outlook 2007 and Outlook 2010, see the article titled Code Security Changes in Outlook 2007.
In the following sections, I describe some of the VBA code samples created by Ron de Bruin.
Mailing Workbooks as E-mail Attachments
The following subroutine sends the last saved version of the active workbook in an e-mail message. Change the mail address and subject in the macro before you run the procedure.
The following subroutine sends a newly created workbook as a copy of the ActiveWorkbook object. Before sending the workbook, it is saved with a date-time stamp. After the file is sent, the workbook is deleted from the hard disk drive.
Tip
Send Excel Worksheet As Attachment
In the previous example, the file wb2 is opened by using the Workbooks.Open method and then mailed, closed, and finally deleted. It is also possible to perform these operations on the file without first opening it. However, by opening the file, you can add code to perform other operations such as the following statement which inserts text and a date into cell A1. You can also perform other operations such as deleting a worksheet or range in the workbook before sending it.
wb2.Worksheets(1).Range('A1').Value = 'Copy created on ' & Format(Date, 'dd-mmm-yyyy')
wb2.Save
Early Binding
If you want to use IntelliSense help show you the properties and methods of objects as you type them into the VBA Code Editor, you can use early binding. For more information about early binding, see the Word MVP site.
To add early binding, follow these steps:
First, add a reference to the Outlook Object Library. Open the VBA editor by typing Alt +F11.
On the Tools menu, click References.
Select Outlook xx Object Library where xx is the version number such as the Microsoft Outlook 12.0 Object Library.
Next, replace the following three statements in the code:
With these three statements.
Mailing Single Sheets as Attachments
The following subroutine sends a newly created workbook with just a single sheet as the ActiveSheet object. The procedure saves the workbook before mailing with a date-time stamp. After the file is sent, the workbook is deleted from the hard disk. Change the mail address and subject in the macro before you run the procedure.
Note
For additional information about how to work with different versions of Excel, see the section following this code block.
Note
You can also use the following statement if you know the sheet you want to mail. It does not have to be the active sheet. Sheets('Sheet5').Copy
Additional Information
In the macro, you see that if Val(Application.Version) < 12 is true, the next statement is as follows: FileExtStr = '.xls': FileFormatNum = -4143. This value represents the workbook format for Excel versions 97 through 2003.
However, if you run the code in Excel 2007 or Excel 2010, the code will look at the file format of the parent workbook and save the new file in that format.
If the parent workbook is a macro-enabled file (.xlsm) and there is no code in the new workbook, the new file will be saved as a macro-free file (. xlsx). This way, the e-mail recipient can recognize that this is a macro-free file. If the parent workbook is not an .xlsx, .xlsm, or .xls file, the new workbook will be saved as an Excel binary file (.xlsb).
The following are the main formats in Excel 2007 and Excel 2010:
51 = xlOpenXMLWorkbook (macro-free file . xlsx)
52 = xlOpenXMLWorkbookMacroEnabled (macro-enabled file . xlsm)
50 = xlExcel12 (Excel binary workbook with or without macros .xlsb)
56 = xlExcel8 (Excel version 97 through 2003 format file .xls)
If you always want to save in a specific format, you can replace the following statements in the macro.
With one of these statements.
In addition to saving the workbook in an Excel file format, you can also save the single-sheet workbook to one of the following formats:
Excel 11 For Mac Send Worksheet As Email Address
Comma separated value file (.csv)
Text file (.txt)
Printable file (.prn.)
You should use one of the following statements, respectively.
If you want to use IntelliSense help show you the properties and methods of objects as you type them into the VBA Code Editor, you can use early binding. See the previous section for more information about early binding.
To use early binding in this procedure, replace these three statements in the code.
With these three statements.
Conclusion
In the second part of this article, you will see the procedures for additional ways to send mail from Excel to Outlook. To continue, read OfficeTalk: Using the Excel Object Model to Send Workbooks and Ranges through E-Mail with Outlook (Part 2 of 2)
About the Authors
Ron de Bruin is an Excel Most Valuable Professional (MVP) and a frequent contributor to the newsgroups. For more information, see Ron's Excel page.
Frank Rice is a senior programming writer and frequent contributor to the Microsoft Office Developer Center.
Comments are closed.