Open new email from excel, and attach the workbook

LordVoldetort_IV

New Member
Joined
Jun 10, 2021
Messages
38
Office Version
  1. 365
Platform
  1. Windows
Hello! i am looking for a piece of VBA code that will allow the person using my workbook to click a button, then it should open a new outlook email addressed to me, have a subject line of "errors and suggestions" and they should then be able to add the body themselves.

a copy of the workbook should also be attached to the email.

The code need not send the email, as the user's input will still be required
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Assign this macro to the button.
VBA Code:
Public Sub Create_Email_Attach_Workbook()

    Dim OutApp As Object
    Dim OutMail As Object
    
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    On Error Resume Next
    With OutMail
        .To = "your.address@email.com"
        .Subject = "Errors and suggestions"
        .Body = "Type body text here"
        .Attachments.Add ActiveWorkbook.FullName
        .Display
    End With
    On Error GoTo 0
    
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,633
Messages
6,125,929
Members
449,274
Latest member
mrcsbenson

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