I am having trouble with code that I wrote a few years ago that saves Outlook attachments. The code looks through my inbox for an email with a specific subject line, then saves the .xls attachment included in that email. This worked beautifully until I upgraded to Windows 10 (and Excel 2016). Now, when the file is saved programatically and I try to open it, I see a bunch of unreadable characters and symbols.
I DO NOT have this problem when I manually double click and open the attachment straight from Outlook, so I think the problem is with the SaveAsFile command in VBA.
Here is the offending code:
olMail.Attachments(i).SaveAsFile strFilePath & strFileName 'after this line executes, I can see the .xls file in my folder
Workbooks.Open strFilePath & strFileName 'when I execute this line, the file opens, but there are crazy characters
Thanks in advance!
Bookmarks