Grabbing OL Mail Attachment, Using XCL VBA Code, Replacing .xlsAttachment, & Mailing
Thanks for your post, Ken.
I have a partial solution.
The problem has to do with creating two instances of Excel. Remember,
I am grabbing a mail item, saving the Excel attachment to my local
hard drive using the same filename, opening it and using Excel VBA
code to modify it, then saving the modified file, using a new name, to
the same folder used in saving the original attachment.
By keeping Task Manager open, I am able to monitor the Excel.exe
process while the macro runs.
I inserted an extra 'xlApp.Quit' in my Code (therefore, a total of
two) (and I am still using the stmt 'xlApp.ActiveWorkbook.Close' in my
Code). The result is that I no longer get an error message and I no
longer get the pop-up modified file spreadsheet. Also, I am able to
have my Code 'Kill" each of the two saved files. The only drawback is
that Excel.exe remains open in the background until I close Outlook,
and then Excel.exe disappears from Task Manager immediately.
Any thoughts?
|