+ Reply to Thread
Results 1 to 2 of 2

Saving Outlook Attachment to Folder not Working Anymore (SaveAsFile)

  1. #1
    Registered User
    Join Date
    10-14-2008
    Location
    Ohio
    Posts
    3

    Saving Outlook Attachment to Folder not Working Anymore (SaveAsFile)

    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!

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Saving Outlook Attachment to Folder not Working Anymore (SaveAsFile)

    I think Excel 2016 uses the .xlsx file extension, not .xls
    You'll have to have it save as .xlsx
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Saving an Outlook Attachment then move to another folder.
    By dflak in forum Outlook Formatting & Functions
    Replies: 7
    Last Post: 10-30-2017, 01:25 PM
  2. [SOLVED] How to get outlook email attachment using excel vba and save it in a specified folder
    By jrtraylor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2016, 08:34 PM
  3. How to prevent VBA Code from saving same outlook attachment again ?
    By avis_1989 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-11-2016, 12:31 PM
  4. Saving File Attachment from Outlook to Network Drive
    By TRMoonPunk in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 10-30-2014, 02:36 PM
  5. Dowload outlook email attachment to my pc folder
    By din.malay in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 12-11-2013, 03:34 AM
  6. Saving Attachment from Outlook to a specified location on my computer
    By dwhite30518 in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 08-15-2012, 10:32 AM
  7. [SOLVED] Outlook attachment to network folder
    By Ozzie via OfficeKB.com in forum Excel General
    Replies: 2
    Last Post: 02-03-2006, 07:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1