A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Thank you for the information.
My question arose because of an issue with the coding below:
'Generate a PDF copy for attachmnt to the email
Sheets("Rslt Sheet").Range("RsltSheetVet").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
lcPath & "Diddly Results Vets.pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "Starters"
'.To = "D Alan Jones <@yahoo.co.uk>; Huw Knight <@ntlworld.com>; Ian Orr <@gmail.com>; Jeremy Sherrard-Smith <@gmail.com>; Mark Ryan <@gmail.com>; Matt Hollis (matthew_@btinternet.com); Michael & Eleanor <@gmail.com>; Ray Anderson <@btopenworld.com>"
.CC = ""
.BCC = ""
.Subject = Range("RsltHeaderVet").Value '"Diddly Results Sheet" & Date
.Body = lcFundMsg
.Attachments.Add lcPath & "Diddly Results Vets.pdf" 'Dest.FullName
' You can add other files by uncommenting the following statement.
'.Attachments.Add ("C:\test.txt")
' In place of the following statement, you can use ".Display" to
' display the e-mail message.
.display
'.Send
End With 'OutMail
The pdf file created remains in the specified folder. When using the code to send the next email the old pdf is sometimes attached to the new email (it sees to be a timing issue with sync). My thought was to delete the old pdf file before creating the new one. As the project is shared with others users via onedrive the inability to delete is a problem. I looked at using the filesystemobject deletefile method but investigation with debug seems to indicate that fso also only sees local drives.
If you can suggest a way round this issue it will be appreciated