ich habe mit dem Attachment noch Probleme, wie bekomme ich denn das aktive Tabellenblatt noch angehängt?
Function MailSenden()
Dim oOL As Object, oOLMsg As Object, oOLRecip As Object, oOAttach As Object
Dim sRec As String, s
Sub As String, sBody As String, sMonth As String, sFile
Dim bln
Application.ScreenUpdating = False
Application.DisplayStatusBar = True
bln = Application.DisplayStatusBar
Set oOL = CreateObject("Outlook.Application")
sRec = Sheets("Grundeinstellungen").Cells(15, 1)
s
Sub = Sheets("Grundeinstellungen").Cells(16, 1) _
& " Monat " & Format(ActiveSheet.Cells(2, 1), "MMMM")
sBody = Sheets("Grundeinstellungen").Cells(17, 1)
sMonth = Format(ActiveSheet.Cells(2, 1), "MMMM")
sFile = ActiveWorkbook.Copy
Application.StatusBar = "Sende Monat " & sMonth & " an " & sRec & "..."
Set oOLMsg = oOL.CreateItem(0)
With oOLMsg
Set oOLRecip = .Recipients.Add(sRec)
.Subject = sSub
.Body = sBody
Set oOAttach = .Attachments.Add(sFile)
.Send
End With
oOLRecip.Resolve
Set oOL = Nothing
Application.StatusBar = False
Application.DisplayStatusBar = bln
End Function
grüße
Henri