alexaronson
Active Member
- Joined
- Sep 30, 2005
- Messages
- 314
Hi and thank you for your help,
I have small macro that process information into a usable format, saves it to a new file, and attaches the new file to an outlook email and sends it to specific people.
When I built my macro and executed it the first time I had no problems.
When I went to run it again the next day, I am getting:
****************************************
"Run-time error '-2147417856 (80010100)':
Automation error
System call failed.
****************************************
When I go to debug, I can just hit play and it continues on and finishes sending the email.
BORfile and folder are declared as strings in the first part of the code.
Any suggestions as to what to do to prevent this error message or on how I can get vba to blow through the error?
Thanks in advance.
I have small macro that process information into a usable format, saves it to a new file, and attaches the new file to an outlook email and sends it to specific people.
When I built my macro and executed it the first time I had no problems.
When I went to run it again the next day, I am getting:
****************************************
"Run-time error '-2147417856 (80010100)':
Automation error
System call failed.
****************************************
When I go to debug, I can just hit play and it continues on and finishes sending the email.
Code:
folder = "C:\Users\TE114889\My Documents\Send to TEIS\"
BORfile = wbName
'the code stops on the next line
With CreateObject("Outlook.Application").CreateItem(0)
.To = "test@test.com"
.Subject = "AMS BOR"
.Body = "AMS BOR sample file to try. Column A = Part Number, Column B = Description, Column C = Work Center, Column D = Activity Type, Column E = Value. This email, file, and text was created and sent by a macro. How cool is that!"
.attachments.Add folder & BORfile
.Send
End With
BORfile and folder are declared as strings in the first part of the code.
Any suggestions as to what to do to prevent this error message or on how I can get vba to blow through the error?
Thanks in advance.