mit folgendem Code erzeuge ich eine PDF Datei, um diese anschließend per E-Mail zu versenden. Nun möchte ich keine PDF sondern eine xlsx Datei als Anhang erzeugen. Hierbei benötige ich Eure Hilfe.
Private Sub CommandButton4_Click()
'Vorschlagsliste
Dim app As Object
Dim file As String
Dim isNew As Boolean
Dim olApp As Object
Dim olOldBody As String
file = Sheets("Tabelle1").Range("H4").Text & ".pdf"
Sheets("VorList").Range("A4:I311").ExportAsFixedFormat xlTypePDF, Environ("TEMP") & "\" & file
On Error Resume Next
Set app = GetObject(, "Outlook.Application")
If app Is Nothing Then
Set app = CreateObject("Outlook.Application")
isNew = True
End If
...anschließend wird die Email erzeugt.
Vielen Dank und Gruß,
Marko