+ Reply to Thread
Results 1 to 5 of 5

Outlook an email with .xls attachment, download and open Workbook

  1. #1
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    171

    Outlook an email with .xls attachment, download and open Workbook

    Hello all,

    I receive an email everyday from the same sender in my general inbox "Inbox" with a .xls attachment. The file is always called the same and the email is always the same just with new data each day. Is there a way to Activate this workbook from a VBA macro, i.e. click macro --> go into outlook --> search for email on current day --> download spreadsheet --> activate it

    The email is produced systematically and is always has Subject "Open Report" and always sent from same sender zq12734@gmail.com

    Can someone pls guide me on the right path.

    Many thanks for your time.

    lougs7

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    2013 / 2016 / 365
    Posts
    7,058

    Re: Outlook an email with .xls attachment, download and open Workbook

    First write an Outlook filter rule to put the email into a folder for this purpose. Make sure this folder is directly under the INBOX. Set up a subfolder under this folder to put the processed mail.

    Then follow the instructions in this article: https://www.excelforum.com/tips-and-...subfolder.html

    The application was designed to handle multiple mailboxes. You'll just need one row in the table.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Outlook an email with .xls attachment, download and open Workbook

    Hi dflak, this will surely help me I will modify accordingly thank you kindly for this. One question, I am not using a shareinbox, it is simply my works email name@company.com and the Main Inbox is called "Inbox". I changed in the sheet where you had Labor Analysis Inbox to -> "Inbox" for Cell B1 Mailbox.

    However I get a break at one of the first lines of code,

    Set FldrIn = oINS,Folders(MailBox).Folders("Inbox").Folders(InFolder)

    How can I configure it using my mailbox, just a standard inbox? Maybe the syntax I put is not right "Inbox"

    EDIT: I put in my email and it worked "name@company.com"
    Last edited by lougs7; 04-09-2020 at 02:14 PM.

  4. #4
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Outlook an email with .xls attachment, download and open Workbook

    Hi dflak,

    Can you quickly direct me how to open the file in the attachment that is being saved (it is a workbook), run a code that I have - that I will paste, then close that sheet, and then it goes back to your code. where would I insert that in your script?

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    2013 / 2016 / 365
    Posts
    7,058

    Re: Outlook an email with .xls attachment, download and open Workbook

    Two things. Your MAilbox is name@company.com That's what goes where I have Labor Analysis.

    To "install" the code is a bit of an issue. The Control Panel has named ranges on it that the code reads. To see what these are (and help you adjust to your code), select a blank part of your spreadsheet and press F3. Then click the button to put in on the sheet. All of these named ranges are static, so it's easy to assign them to your cells. For example, if you want to assign the name Mailbox to Cell C4, select C4 and go to the name box (upper left of screen below the ribbon) - it will read Cr - put the cursor in there and type in Mailbox.


    Once you got that, your can copy and paste the code into a module in your workbook.

+ 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. download attachment from outlook email
    By saurabhlotankar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2017, 05:39 AM
  2. Auto outlook email copy attachment of excel workbook
    By kor123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2016, 12:25 AM
  3. Open excel attachment from email in Outlook and copy and paste into workbook
    By RubiksCuber in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-05-2016, 10:26 PM
  4. Create macro to open daily email and Excel attachment from Outlook
    By wardpa in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-02-2013, 10:26 AM
  5. Create macro to open daily email and Excel attachment from Outlook
    By uimhirADo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2012, 09:23 PM
  6. Open an attachment from an email in Outlook
    By TypicalDru in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2012, 12:34 PM
  7. Excel Spreadsheet email attachment unable to open in Outlook Expr.
    By Joanne from Tiffin, Oh in forum Excel General
    Replies: 1
    Last Post: 04-22-2005, 08:06 PM

Tags for this Thread

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