Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there an easy way to data read excel files that are attached in emails in Outlook? Im sure this is scriptable, but I dont particularly want to write it.

Is there a program out there that can accomplish this?

share|improve this question

A broad answer given your question wasn't very detailed

  • ie what do you mean by read,
  • all messages in a folder etc)

You can strip all the Excel files from all messages in an Outlook folder with the following VBA

This code looks at messages in a Outlook folder called "temp" below the Inbox Any Excel files as attachments are saved to C:\test

Other sample code at

Sub SaveOlolAttachments()

    Dim olFolder As Outlook.MAPIFolder
    Dim olMsg As Outlook.MailItem
    Dim olAtt As Outlook.olAttachment
    Dim fsSaveFolder As String
    strSaveFolder = "C:\test\"

    'My testing done in Outlok using a "temp" folder underneath Inbox
    Set olFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
    Set olFolder = olFolder.Folders("Temp")
    If olFolder Is Nothing Then Exit Sub

    For Each olMsg In olFolder.Items
        For Each olAtt In olMsg.olAttachments
            If Right$(olAtt.FileName, Len(olAtt.FileName) - InStrRev(olAtt.FileName, ".")) Like "xl?*" Then olAtt.SaveAsFile fsSaveFolder & olAtt.FileName
End Sub
share|improve this answer
cool thanks, i will test it out. will have to tweak it a little to grab the right files and save them uniquely. – Keltari Dec 8 '11 at 16:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.