Thema Datum  Von Nutzer Rating
Antwort
22.04.2020 11:54:27 Chris
Solved
22.04.2020 12:05:15 Mase
NotSolved
22.04.2020 12:13:29 Gast12939
NotSolved
22.04.2020 12:27:59 Mase
NotSolved
22.04.2020 12:41:31 Chris
NotSolved
22.04.2020 12:46:30 Mase
NotSolved
22.04.2020 13:00:16 Gast82930
NotSolved
22.04.2020 13:06:16 Mase
NotSolved
22.04.2020 13:13:35 Chris
NotSolved
22.04.2020 13:33:32 Mase
NotSolved
22.04.2020 13:39:53 Chris
NotSolved
22.04.2020 13:48:12 Mase
NotSolved
22.04.2020 13:52:01 Chris
NotSolved
22.04.2020 13:54:16 Mase
NotSolved
22.04.2020 14:04:27 Chris
NotSolved
22.04.2020 14:13:09 Mase
NotSolved
Rot Tabellenblatt temporär als pdf speichern und per Mail versenden
22.04.2020 14:16:27 Gast90230
NotSolved
22.04.2020 14:36:12 Mase
NotSolved
22.04.2020 14:44:35 Chris
NotSolved
22.04.2020 14:48:46 Chris
NotSolved
22.04.2020 15:08:26 Mase
NotSolved
22.04.2020 15:28:44 Chris
NotSolved
22.04.2020 15:46:37 Chris
NotSolved
22.04.2020 15:47:40 Mase
Solved

Ansicht des Beitrags:
Von:
Gast90230
Datum:
22.04.2020 14:16:27
Views:
820
Rating: Antwort:
  Ja
Thema:
Tabellenblatt temporär als pdf speichern und per Mail versenden

'export File as PDF
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=AWS, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False

 

 

dort tritt der fehler auf, die selbe Fehlermeldung mit dem Speichern

und das ist der verwendete Code:


Option Explicit
 
Const MYPATH As String = "c:\Test\"
 
Sub MacroMitDeinemFormularSteuerelementVerknuepfen()
    Dim sText As Variant
       
    sText = "<div>Sehr ....<br>"
    sText = sText & "<p>foo bar bar foo</p>"
    sText = sText & "<br>MfG</div>"
       
       
    Call SendSheetOutlook( _
                            "Betreffzeile", _
                            "EMailAnZeile_als_Emailadresse_getrennt_durch_Simikolon", _
                            "EmailCCZeile", _
                            sText)
End Sub
 
Private Sub SendSheetOutlook(sSubject As String, sTo As String, sCC As String, ByVal sText As String)
Dim olApp         As Object
Dim AWS           As String
Dim olOldBody     As String
   
'define temporary Path and Filename
AWS = MYPATH & "\" & Format(Date, "YYYYMMDD") & "_" & Format(Time, "hhmmss") & "_" & _
WorksheetFunction.Substitute(ActiveWorkbook.Name, ".xlsm", "")
   
'export File as PDF
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=AWS, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
AWS = AWS & ".pdf"
   
'Make Email
Set olApp = CreateObject("Outlook.Application")
   With olApp.CreateItem(0)
             .GetInspector.Display
             olOldBody = .htmlBody
             .To = sTo
             .cc = sCC
             .Subject = sSubject
             .htmlBody = sText & olOldBody
            .Attachments.Add AWS
   End With
      
'remove TEMP file
'********************************
'wenn du das PDF behalten möchtest, diese Zeile auskommentieren!
'sonst wird das temporäre PDF wieder gelöscht
'Kill AWS
'********************************
End Sub
 


 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
22.04.2020 11:54:27 Chris
Solved
22.04.2020 12:05:15 Mase
NotSolved
22.04.2020 12:13:29 Gast12939
NotSolved
22.04.2020 12:27:59 Mase
NotSolved
22.04.2020 12:41:31 Chris
NotSolved
22.04.2020 12:46:30 Mase
NotSolved
22.04.2020 13:00:16 Gast82930
NotSolved
22.04.2020 13:06:16 Mase
NotSolved
22.04.2020 13:13:35 Chris
NotSolved
22.04.2020 13:33:32 Mase
NotSolved
22.04.2020 13:39:53 Chris
NotSolved
22.04.2020 13:48:12 Mase
NotSolved
22.04.2020 13:52:01 Chris
NotSolved
22.04.2020 13:54:16 Mase
NotSolved
22.04.2020 14:04:27 Chris
NotSolved
22.04.2020 14:13:09 Mase
NotSolved
Rot Tabellenblatt temporär als pdf speichern und per Mail versenden
22.04.2020 14:16:27 Gast90230
NotSolved
22.04.2020 14:36:12 Mase
NotSolved
22.04.2020 14:44:35 Chris
NotSolved
22.04.2020 14:48:46 Chris
NotSolved
22.04.2020 15:08:26 Mase
NotSolved
22.04.2020 15:28:44 Chris
NotSolved
22.04.2020 15:46:37 Chris
NotSolved
22.04.2020 15:47:40 Mase
Solved