Posts by jiminykricket

    Re: Open Outlook attachment from specific sender with today's date


    Well, i could do that but it would still have to be a sheet in a separate workbook (Mine currently auto-runs upon open then auto-closes down). In this instance how would i reference the list of names in your code, assuming the book would be called names.xls, sheet 1, as an example?

    Re: Open Outlook attachment from specific sender with today's date


    Hi Krishnakumar,


    Sorry to be a pest, but i have one more request..


    I have setup the code to run automatically upon opening the spreadsheet. This is fine except in the super rare instance where a different sender than the usual three, send me the email (typically this happened to me this morning for the first time in months, the second time having used the new spreadsheet :smash: ) . So, what i was thinking was maybe having a notebook/text file in the same directory as the spreadsheet, where i could list the possible email senders. This way any new senders i can add on the list, instead of having to try and access the spreadsheet without it auto-running. This would also mean my colleagues who are less able than i at vba (i know you're shocked, but they do exist) are able to update the list without searching through code.


    Many thanks,


    James


    p.s. if you can suggest a better option i'm happy to hear it!

    Hi all,


    On a daily basis i receive an email with an attachment (the email will come from one of three different people). I want to be able to open this attachment, move the data into my workbook, then run my vba code on it (This to modify it, save as a txt file and close). The attachment has a different name each day - a string of 12 different letters or numbers, but always ends ".000001.csv", if that helps.


    My code to modify etc all works fine. The part i'm struggling with is the Outlook link. I have searched far and wide but i'm not finding anything suitable (although my lacking knowledge may also be at play here). The issue generally seems to be that people want code to loop through their entire inbox, whereas i just want it to find the most recent email from said recipient, execute then stop. It goes to a general inbox and therefore it has to be specific as i do not want to open 1000+ attachments by accident!


    I only receive one email per day from this recipient, hence a "today" qualifier may be useful (although not required) to prevent it opening yesterdays/previous email.


    I have my code if required, but none is relevant to the question so i don't want to 'muddy' the answer.


    Many thanks in advance!