I have a number of differrent workbook books with different codes which attach a workbok or a worksheet as a pdf to outlook email to send, everything works fine up till the point when i go to click send in outlook i get the error message unable to perform operation because object has been deleted however the object hasnt. this problem has only occured recently as we have been using similar code before and it worked.
we have opened outlook in safe mode and it works. so i think the problem lays with outlook
i have attached my code for the pdf converter macro
Dim strNewFolderName As String
Dim sh As Worksheet
Dim wb As Workbook
Dim OutApp As Object
Dim OutMail As Object
Dim sPDF_Name As String
Dim sFilePath As String
Dim sFileName As String
sPDF_Name = sFilePath & sFileName & ".pdf"
sPDF_Name = "C:\" & Range("C5").Value & " " & "ASM Report" & " " & Range("m4").Value & ".pdf"
.ScreenUpdating = False
.EnableEvents = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
.To = ""
.CC = ""
.BCC = ""
.Subject = Range("C5").Value & " " & "ASM Report" & " " & Range("m4").Value & ".pdf"
.Body = " "