Hi again!
Really not sure why I'm getting this message. I have various pieces of VBA code all pointing to this same document in my DB with no problems. Now I want to try and attach this file to an email I'm getting this error message. The file exists, the path hasn't changed!
This is the code:
Help most appreciated
Really not sure why I'm getting this message. I have various pieces of VBA code all pointing to this same document in my DB with no problems. Now I want to try and attach this file to an email I'm getting this error message. The file exists, the path hasn't changed!
This is the code:
Code:
Private Sub Command23_Click()
Dim oApp As New Outlook.Application
Dim oEmail As Outlook.MailItem
Dim fileName As String
'Preparing Spreadsheet to send to directors
'First select the tracker just created
fileName = Application.CurrentProject.Path & "\Tracker"
'Email result of spreadsheet just created
Set oEmail = oApp.CreateItem(olMailItem)
With oEmail
.Recipients.Add "test@test.com"
.Subject = "Tracker"
.Body = "Please find attached this weeks Tracker"
.Attachments.Add fileName
.Display
End With
End Sub
Help most appreciated