Live-Forum - Die aktuellen Beiträge
Datum
Titel
28.03.2024 21:12:36
28.03.2024 18:31:49
Anzeige
Archiv - Navigation
1656to1660
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Excel Bereich als pdf Anhang senden

Excel Bereich als pdf Anhang senden
12.11.2018 14:26:40
Nicolai
Hallo Zusammen,
ich bin auf der Suche nach einem Makro, welches einen bestimmten Bereich (A1:D20) als PDF Anhang versendet.
Ich habe leider nur Makros gefunden, welche entweder nicht funktionieren oder sie nur eine Bereich in eine E-Mail kopieren.
Vielen Dank & freundliche Grüße,
Nicolai Sattler

5
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Excel Bereich als pdf Anhang senden
12.11.2018 14:36:25
japes36

Sub PDFundSenden()
Dim OutlookAPP As Object
Dim OutlookMailItem As Object
Dim strPDF As String
Const strPath As String = "K:\100_DE_After_Sales\280_Sales_Consultant\600_Umsatzreport_\"
strPDF = strPath & Range("Z18")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strPDF
Set OutlookAPP = CreateObject("outlook.application")
Set OutlookMailItem = OutlookAPP.CreateItem(0)
With OutlookMailItem
.to = Range("Z15")
.Subject = Range("Z16")
.Body = "xx"
.Attchements.Add strPDF
'.send
.Display
End With
Set OutlookAPP = Nothing
Set OutlookMailItem = Nothing
End Sub

Anzeige
AW: Excel Bereich als pdf Anhang senden
12.11.2018 14:36:31
japes36

Sub PDFundSenden()
Dim OutlookAPP As Object
Dim OutlookMailItem As Object
Dim strPDF As String
Const strPath As String = "K:\100_DE_After_Sales\280_Sales_Consultant\600_Umsatzreport_\"
strPDF = strPath & Range("Z18")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strPDF
Set OutlookAPP = CreateObject("outlook.application")
Set OutlookMailItem = OutlookAPP.CreateItem(0)
With OutlookMailItem
.to = Range("Z15")
.Subject = Range("Z16")
.Body = "xx"
.Attchements.Add strPDF
'.send
.Display
End With
Set OutlookAPP = Nothing
Set OutlookMailItem = Nothing
End Sub

Anzeige
AW: Excel Bereich als pdf Anhang senden
12.11.2018 14:36:34
japes36

Sub PDFundSenden()
Dim OutlookAPP As Object
Dim OutlookMailItem As Object
Dim strPDF As String
Const strPath As String = "K:\100_DE_After_Sales\280_Sales_Consultant\600_Umsatzreport_\"
strPDF = strPath & Range("Z18")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strPDF
Set OutlookAPP = CreateObject("outlook.application")
Set OutlookMailItem = OutlookAPP.CreateItem(0)
With OutlookMailItem
.to = Range("Z15")
.Subject = Range("Z16")
.Body = "xx"
.Attchements.Add strPDF
'.send
.Display
End With
Set OutlookAPP = Nothing
Set OutlookMailItem = Nothing
End Sub

Anzeige
AW: Excel Bereich als pdf Anhang senden
12.11.2018 14:36:53
japes36

Sub PDFundSenden()
Dim OutlookAPP As Object
Dim OutlookMailItem As Object
Dim strPDF As String
Const strPath As String = "K:\100_DE_After_Sales\280_Sales_Consultant\600_Umsatzreport_\"
strPDF = strPath & Range("Z18")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strPDF
Set OutlookAPP = CreateObject("outlook.application")
Set OutlookMailItem = OutlookAPP.CreateItem(0)
With OutlookMailItem
.to = Range("Z15")
.Subject = Range("Z16")
.Body = "xx"
.Attchements.Add strPDF
'.send
.Display
End With
Set OutlookAPP = Nothing
Set OutlookMailItem = Nothing
End Sub

Anzeige
AW: Excel Bereich als pdf Anhang senden
12.11.2018 16:49:00
niclaus
Hallo Namensvetter
Ich hätte da auch noch etwas. - Im Makro musst Du anpassen:
· den Ordner, in dem der Tabellenausschnitt gespeichert wird
· den Empfänger-Namen - kann auch leer bleiben
· Subject und Body - können auch leer bleiben
Bei mir mit Office 2013 klappt das so bestens. Ich hoffe bei Dir auch.
Grüsse Nicolaus
Sub Makro2()
' Ausschnitt aus Tabelle als PDF verschicken
Dim mgb
Dim ordner$, dateiname$, AWS$, Empfaenger$
Dim MyMessage As Object, MyOutApp As Object
Dim Qe As Integer
mgb = MsgBox("Ist Outlook geoeffnet?", 36, Environ("UserName"))
If mgb = 7 Then Exit Sub
Empfaenger = "xxxxx@bluewin.ch"
ordner = "D:\Documents\0000_TEST2\"
dateiname = Format(Now, "yyyymmdd_hhmmss") & ".pdf"
' Auswahl der Excel-Tabelle wird als PDF erstellt
Range("A1:D20").Select
Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ordner & dateiname, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
'Outlook Object und Nachricht erstellen
'Absender ist die Standard-Versand-Adresse
AWS = ordner & dateiname
Set MyOutApp = CreateObject("Outlook.Application")
Set MyMessage = MyOutApp.CreateItem(0)
With MyMessage
.To = Empfaenger
.Subject = "pdf Versand"    ' Betreff
.Attachments.Add AWS
.Body = "irgend ein Text"   ' Ein Text im Email.
.Display
'.Send      ' statt .Display! - Mail wird direkt verschickt.
End With
'Variablen leeren
Set MyOutApp = Nothing
Set MyMessage = Nothing
End Sub

Anzeige

310 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige