ich suche nach einem VBA Code, welcher folgende Funktion mit sich bringt:
Bei E10 wäre eine Zahl zB: 28 - Daher müsste das PDF im Ordner 28 gespeichert werden.
strPDFRapport = ThisWorkbook.Path & Application.PathSeparator _
& "Filiale " & Format(.Range("E10").Value, "000") _
& " Rapport " & Format(Date, "YYYY-MM-DD") & ".PDF"
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strPDFRapport, _
Quality:=xlQualityStandard, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
der heutige Code für den Mailversand im PDF lautet:
'E-Mailversand
If LCase(Left(Application.OperatingSystem, 7)) = "windows" Then
'Mail-/PDF-Versand unter Windows/MS-Office/MS-Outlook
'PDF-Dateien speichern - Funktion unter MAC ?
bolRetouren = (.Cells(16, 5).Value = "_" Or .Cells(16, 5).Value = "þ")
'Rapport als PDF speichern
strPDFRapport = ThisWorkbook.Path & Application.PathSeparator _
& "Filiale " & Format(.Range("E10").Value, "000") _
& " Rapport " & Format(Date, "YYYY-MM-DD") & ".PDF"
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strPDFRapport, _
Quality:=xlQualityStandard, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
If bolRetouren Then
'Retourenblatt als PDF speichern
Sheets("RETOURENFORMULAR").Select
strPDFRetouren = ThisWorkbook.Path & Application.PathSeparator _
& "Filiale " & Format(.Range("E10").Value, "000") _
& " Retouren " & Format(Date, "YYYY-MM-DD")
strPDFRetouren = strPDFRetouren & ".pdf"
strXLSRetouren = strPDFRetouren & ".xlsx"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strPDFRetouren, _
Quality:=xlQualityStandard, IncludeDocProperties:=False, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Call SpeichernRetourenFormular(strFilename:=strXLSRetouren, lngFileformat:=51)
Sheets("RAPPORT").Select
End If
'Mailversand via Outlook
Call fncMailOutlook(varTo:=.Range("J13").Text, _
strSubject:=.Range("B10").Text & " " & .Range("C10").Text _
& " / " & .Range("B11").Text & " " & .Range("C11").Text _
& " " & .Range("E10").Text & " " & .Range("E11").Text, _
strBody:="Geschätzte Filialleitung, geschätzte Einkaufsleitung" & Chr(10) & Chr( _
_10) _
& "Anbei senden wir Ihnen den gewünschter Rapport Ihrer Fust Filiale zu.", _
_
olAction:="Display", varCC:=.Range("L13").Text, varBCC:="", _
varAttachments:=IIf(bolRetouren, Array(strPDFRapport, strPDFRetouren, _
strXLSRetouren), _
strPDFRapport))
Else
könnt ihr mir dabei helfen? Lg
Jamie