VBA issue on email send not inlcuding embeded objects

ryan_law2000

Well-known Member
Joined
Oct 2, 2007
Messages
738
everyone I have the following code that works by send the excel workbook as an attachment in an email.
The issue is the excel workbook has many embedded files within it and they are not getting sent with the email.
But if I go file share and send as attachment they are there. Any ideas how to modify this VBA to include embedded files?

Code:
Sub EmailFinalTicket()
Dim OutlookApp As Object
Dim OutlookMail As Object
Serviceline = Worksheets("Main").Range("C20")

If (Worksheets("Main").Range("C20") = "test" Or Worksheets("Main").Range("C20") = "test") Then
'If (Serviceline = "test" Or Serviceline = "test") Then
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
With OutlookMail
    .To = ""
    .CC = "ryan"
    .BCC = ""
    .Subject = "GEAR / Job # " & Range("C6").value & " / " & Range("C7").value
    .Body = ""
    .Attachments.Add Application.ActiveWorkbook.FullName
    .Display
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End If
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
20,222
Office Version
  1. 365
Platform
  1. Windows
Your code works for me. I created a workbook and embedded an Excel workbook, Word document, and text file. Then I ran your code. It attached the workbook to an email, I sent it to myself, and I was able to open the attachment. The embedded files were there, and I was able to open all of them. Actually, I should have included a PDF file in the testing. What type of files do you have embedded in your workbook?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,012
Messages
5,834,914
Members
430,326
Latest member
tomwax46

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
Top