ich moechte aus einem Tabellenblatt eine Email verschicken. Das Makro funktioniert auch, aber nur im Editor.
Wenn ich es aber ueber den Commandbutton versuche, passiert nichts.
Was mache ich falsch?
Gruss
Matthias
Private Sub CommandButton1_Click()
If CommandButton1 = False Then
ActiveWorkbook.Save
Dim Nachricht As Object, OutApp As Object
Set OutApp = CreateObject("Outlook.Application")
Dim AWB As String
AWB = ThisWorkbook.FullName
InitializeOutlook = True
Set Nachricht = OutApp.CreateItem(0)
With Nachricht
.to = "Empfänger"
.Subject = "Betreff"
.attachments.Add AWB
.Body = "" & vbCrLf & ""
.Display
End With
Set OutApp = Nothing
Set Nachricht = Nothing
End If
End Sub