How To Mail the Activeworkbook using VBA in Microsoft Excel?
Tags: tomailtheactiveworkb, vbamacros
Published: 2021-09-30 05:37:41

---
title: How To Mail the Activeworkbook using VBA in Microsoft Excel?
published: true
date: 2021-09-27 12:31:11 UTC
tags: ToMailTheActiveworkb,VBAMacros
canonical_url: https://geekexcel.com/how-to-mail-the-activeworkbook-using-vba-in-microsoft-excel/
---

In this tutorial, we will guide you on how to **mail the activeworkbook using VBA** in Microsoft Excel. Let’s get them below!! Get an official version of MS Excel from the following link: **[https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)**

## Example

- Firstly, in the Excel Worksheet, you have to go to the  **Developer Tab.**
- Then, you need to ** ** select the  **Visual Basic**  option under the  **Code**  section.

![Select Visual Basic](https://geekexcel.com/wp-content/uploads/2021/09/Select-Visual-Basic-9-1024x180.png)<figcaption>Select Visual Basic</figcaption>

- Now, you have to  **copy and paste the code**  given below.

```
Sub Mail_workbook()
    ActiveWorkbook.SendMail "ron@debruin.nl", _
                            "This is the Subject line"
End Sub

```

- If you want to **mail the workbook** where the code is placed, you have to use the following line given below.

```
ThisWorkbook.SendMail "ron@debruin.nl", _

```

- You need to  **save the code**  by selecting it and then  **close the window**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Save-the-Code-84.png)<figcaption>Save the Code</figcaption>

- Again, you have to go to the  **Excel Spreadsheet** , and click on the  **Developer Tab**.
- You need to choose the  **Macros option**  in the Code section.

![Choose Macro option](https://geekexcel.com/wp-content/uploads/2021/09/Choose-Macro-option-11-1024x184.png)<figcaption>Choose Macro option</figcaption>

- Now, you have to make sure that your  **macro name is selected**  and click the  **Run ** button.

![](https://geekexcel.com/wp-content/uploads/2021/09/Run-the-Code-53.png)<figcaption>Run the Code</figcaption>

- Finally, you can **mail the activeworkbook** using VBA in Microsoft Excel.

## A Short Summary

Here, we have explained the step-by-step procedure on how to **mail the activeworkbook using VBA** in Microsoft Excel. Make use of this. Please share your worthwhile  **feedback**  in the below  **comment**  section. To learn more, check out our website **[Geek Excel](https://geekexcel.com/)!!**

**Read Also:**

- **[Count the Number of Words in a Cell or a Range in Excel Office 365!!](https://geekexcel.com/count-the-number-of-words-in-a-cell-or-a-range-in-excel-office-365/)**
- **[Excel Formulas Check the Cell Contains Some Words but Not Others!!](https://geekexcel.com/excel-formulas-check-the-cell-contains-some-words-but-not-others/)**
- **[Excel Formulas to Count Total Words in a Cell ~ Easy Guide!!](https://geekexcel.com/excel-formulas-to-count-total-words-in-a-cell/)**
- **[Formulas for Counting the Number of Words in a Cell or Range in Excel!!](https://geekexcel.com/formulas-for-counting-the-number-of-words-in-a-cell-or-range-in-excel/)**
- **[Excel Formulas to Count Total Words in a Range ~ Useful Tips!!](https://geekexcel.com/excel-formulas-to-count-total-words-in-a-range/)**