MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Receive emails from various locations (emails are received/downloaded into Microsoft Outlook on

  Asked By: Madeline    Date: Nov 26    Category: MS Office    Views: 1452

What I need to do is:

1. Receive emails from various locations (emails are
received/downloaded into Microsoft Outlook on my desktop).
2. Open email
3. Open the excel workbook attachment
4. Select data from the particular sheet called "drd" (fixed no of
columns and but variable no of rows)
5. Paste it on another workbook called "database"
6. Open another email perform step 2 to step 5
7. Perform this process for all the emails received.

I have tried to create a macro but that macro is not running for all
emails. Because:

1. The file name (email attachment excel workbook) is not the same
for all emails
2. The sheet name is not in the same for all workbooks
3. Starting row or starting column is not the same (this happens
frequently but not always).
4. The subject is different for all emails received.

Ultimately what I am trying to do is as soon as an email comes in my
inbox that mail should be opened then the excel workbook is should
be opened and the data should be copied and pasted in one excel work
book to create database. If the database is created, job is done.

I request each and every group member kindly help me how to proceed.



2 Answers Found

Answer #1    Answered By: Anselma Schmidt     Answered On: Nov 26

I think you have specified the exact problem and solution yourself. As I
see it, there is not enough consistency in the workbooks, or email  names
being received. Whilst it is possible to code for these exceptions, it
would be much easier to just enforce a common standard onto your data
supply group.

Things like different starting  points in workbooks, or different sheet
names should not be allowable.

Answer #2    Answered By: Dang Tran     Answered On: Nov 26

Your task is rather complicated due to the lack of consistency with
email and spreadsheet data. It may be worth while to look outside the
box on this one. Is all this information being sent to you internally or
from outside business contacts? Depending on the answer you may be
better off speaking with management about creating, or using an existing
database and have internal staff enter data  this way. If you are dealing
with external contacts, then it's time to discuss having them send you
tab delimited text files. This not only helps enforce data integrity but
you can have your contacts upload the files via FTP to your network
server. Then by writing a script, have your program search for each file
and load it automatically into your database.