I have the below code set that has worked for several years for a specific report but is no longer working since Office was upgraded to 365. I am now getting a Run-Time error '1004': Application-defined or object-defined error after the message box asks for confirmation. I'm wondering if has something to do with library resources? Macro security settings appear to be ok. Any ideas?
Sub SendAsPDF
Dim sBlatt As String
Dim sPdfDateiF5 As String
Dim OutApp As Object
Dim OutMail As Object
If MsgBox("Send the order as a E-Mail?", 4, "Frage") = vbYes Then
sPdfDateiF5 = "FilePath" & ".pdf"
(ERROR OCCURS DURING BELOW CODE)
ActiveWorkbook.Sheets("Form Pallet").ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=sPdfDateiF5, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
After this code it sends the attached PDF to a distribution list via Outlook.
Sub SendAsPDF
Dim sBlatt As String
Dim sPdfDateiF5 As String
Dim OutApp As Object
Dim OutMail As Object
If MsgBox("Send the order as a E-Mail?", 4, "Frage") = vbYes Then
sPdfDateiF5 = "FilePath" & ".pdf"
(ERROR OCCURS DURING BELOW CODE)
ActiveWorkbook.Sheets("Form Pallet").ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=sPdfDateiF5, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
After this code it sends the attached PDF to a distribution list via Outlook.