View Single Post
  #1 (permalink)  
Old October 26th, 2006, 06:30 AM
kidbass kidbass is offline
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default E-Mail Attachments

How do I set up a macro that will attach a workbook to an e-mail without sending it automatticly

I use the following to send e-mail auto for me;

Sub EMail_Workbook_SCM()


If MsgBox("Click OK to send report", vbOKCancel, _
    "You are about to send this report to Supply Class Management") = vbCancel Then Exit Sub



    Dim wb1 As Workbook
    Dim wb2 As Workbook
    Dim wbname As String
    ActiveWorkbook.Save
    Application.ScreenUpdating = False
    Set wb1 = ActiveWorkbook
    wbname = "C:/" & wb1.Name & " " & _
    Format(Now, "dd-mm-yy") & ".xls"
    wb1.SaveCopyAs Filename:=wbname
    Set wb2 = Workbooks.Open(wbname)
    With wb2
        .SendMail "KBR.lc3.DOLSupCM@kbr.com"
        .ChangeFileAccess xlReadOnly
        Kill .FullName
        .Close False
    End With
    Application.ScreenUpdating = True
End Sub