The code that I am posing below sends the email, but it does not attach the Excel file. Is this a quick fix? Any help is greatly appreciated.
Code:
Private Sub CommandButton1_Click()
Dim SabineID As String
Dim strpath As String
Dim strtask As String
Application.ScreenUpdating = False
ActiveSheet.Select
ActiveSheet.Copy
strpath = Range("AA1").Value
SabineID = Range("V18").Value
strtask = Range("A18").Value
strarea = Range("b18").Value
stremail = Range("j2").Value
ActiveSheet.SaveAs Filename:= _
"S:\KBR Forecast\KBR PEO-Equipment Requests\KBR PEO-Equipment Requests" & strtask & " " & "KBR Equipment Request Form" & " " & Format(Date, "MM-DD-YYYY") & "-" & Format(Now, "hh") & Format(Now, "mm") & Format(Now, "ss") & ".xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Dim Email_Subject, Email_Send_From, Email_Send_To, _
Email_Cc, Email_Bcc, Email_Body As String
Dim Mail_Object, Mail_Single As Variant
Email_Subject = "KBR PEO-Equipment Requests" & "_" & Format(Date, "yyyy-mm-dd")
'Email_Send_From = ""
Email_Send_To = "ryan.e.carr@dupont.com"
'Email_Cc = ""
'Email_Bcc = ""
'Email_Body = ""
On Error GoTo debugs
Set Mail_Object = CreateObject("Outlook.Application")
Set Mail_Single = Mail_Object.CreateItem(0)
With Mail_Single
.Subject = Email_Subject
.To = Email_Send_To
'.cc = Email_Cc
'.BCC = Email_Bcc
'.Body = Email_Body
.send
End With
debugs:
If Err.Description <> "" Then MsgBox Err.Description
MsgBox "Your form has been submitted"
Application.ScreenUpdating = True
ActiveWorkbook.Close
End Sub