How to attach with excel file that was automatically deleted the excel sheet during sending an email

anthonymedz

Board Regular
Joined
Jan 30, 2015
Messages
69
Hi guys,

Good day.
Can you help me on this.

When I click the command button the outlook mail will automatically appear with an attachment, however I want the excel sheet on that excel file have been deleted(Sheet 1 or 2).

Code:
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)


strbody = "<H3><B>Hi Team,</B></H3>" & _
"Please see the attached shift report for your reference.<br>" & _

On Error Resume Next


With OutMail
.Display
.To = "medz_anthony"
.CC = ""
.BCC = ""
.Subject = "FM-Gaming & Podium Operation Daily Departmental Report_3rd Shift"
.HTMLBody = strbody & "<br>" & .HTMLBody
.Attachments.Add ActiveWorkbook.FullName
'.Send

End With


On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing

Thanks for your advanced help.

Regards,
Anthonymedz
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,216,113
Messages
6,128,905
Members
449,478
Latest member
Davenil

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