I have a scheduled task set up to open an access app, run a query and send excel file each morning. Actually works great but I am havng a problem the first time this code runs after booting the computer where it does not send the attached excel file in a readable excel file format. After that it runs great each day.....as long as I don't reboot the computer for some reason.
The email sends fine....it's just the attached file that can't be read. Is there something else I should be doing with the code to prevent this issue. Seems like there's something else I need to be initializing b4 sending that attachment.
My code below.
Again....it's only the very first time after booting the computer.....after that, it works fine.
With MailOutLook
.To "email@someaddress"
.Subject = "My Subject Line"
.Attachments.Add "Path to excel file"
.Send
End With
Many thanks...Toga
The email sends fine....it's just the attached file that can't be read. Is there something else I should be doing with the code to prevent this issue. Seems like there's something else I need to be initializing b4 sending that attachment.
My code below.
Again....it's only the very first time after booting the computer.....after that, it works fine.
With MailOutLook
.To "email@someaddress"
.Subject = "My Subject Line"
.Attachments.Add "Path to excel file"
.Send
End With
Many thanks...Toga