I have a macro to create an email and attach a workbook, which works perfectly to attach the active workbbook
However, I need the macro amended so that it attaches all the csv files in the folder "C:\sales JNLS\
Your assistance is most appreciated
![]()
Sub Email_filesInFolder() ThisWorkbook.Activate 'start in THIS workbook ztext = [bodytext] 'read in text from named cell Zsubject = [subjectText] Dim OutApp As Object Dim OutMail As Object Dim Strpath As String Dim Strfile As String Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) With OutMail .To = Join(Application.Transpose(Sheets("Data").Range("AU1:AU2").Value), ";") .CC = "" .BCC = "" .Subject = Zsubject .Body = ztext .Attachments.Add ActiveWorkbook.FullName .Display End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub
Bookmarks