1. Welcome! Please take a few seconds to create your free account to post threads, make some friends, remove a few ads while surfing and much more. ClutchFans has been bringing fans together to talk Houston Sports since 1996. Join us!

Excel: Importing from an Access database to an excel spreadsheet

Discussion in 'BBS Hangout' started by Cohete Rojo, Mar 25, 2011.

Tags:
  1. Cohete Rojo

    Cohete Rojo Member

    Joined:
    Oct 29, 2009
    Messages:
    10,344
    Likes Received:
    1,203
    A coworker of mine has built a macro that imports data from an access database file to an excel spreadsheet. We now need a way to do this on a timed interval like every 5 minutes. Is anyone familiar enough with microsoft to know how to do this? And a follow up, is there a way to automatically update save an excel file from an email attachment, have it run a macro and then export data from that excel file to another?

    I don't expect ya'll to have step by steps, I was just hoping someone knew a website or something. yes, I have searched but I'd like to see what you expierenced veterans rely on. Thanks.
     
  2. Lil Pun

    Lil Pun Member

    Joined:
    Oct 6, 1999
    Messages:
    34,143
    Likes Received:
    1,038
    excelforum.com
     
  3. arkoe

    arkoe (ง'̀-'́)ง

    Joined:
    Dec 13, 2001
    Messages:
    10,387
    Likes Received:
    1,598
  4. ScriboErgoSum

    ScriboErgoSum Member
    Supporting Member

    Joined:
    Aug 5, 2002
    Messages:
    3,149
    Likes Received:
    387
    arkoe is right. I would use a timer and just have it update data every X number of seconds.

    You can play between Excel and Outlook (that's how the Melissa virus worked). I do this to send out custom emails with attachments as well as parse text out of emails to update a database.

    Opening attachments, reading data, and updating another file would be a lot trickier. You'd probably have to have the attachments in a pretty standard format. You'd also want the emails to automatically go into a specific folder (you can do this via Outlook rules pretty easily, but you'd probably need some kind of unique subject line or body text so the rule knows which emails to filter). Then it would be a matter of parsing the email, saving the file with a specific name, firing a macro on the original file to open and parse that excel file, and then update your database. Keep in mind that after Office 2000, Microsoft made it a much bigger pain in the ass to fire Outlook marcos due to the Melissa virus and other hacks. Usually you have to manually OK every time an external source tries to access Outlook, but you can get around that with digitial certificates and such.
     
  5. heypartner

    heypartner Member

    Joined:
    Oct 27, 1999
    Messages:
    63,512
    Likes Received:
    59,010
    Loading data in 5-minute, timed intervals is dangerous, and often unneeded.

    From a user's perspective, refresh data on File Open achieves the same thing. That is, execute your import Macro on File Open. You could also create a Button in Excel that executes your current import macro. Call it something like "Refresh Data."

    I find few examples where data integration from primary source needs to be full synchronized in an automatic fashion. An example is where other application functions are doing ongoing, automated operations on the destination database (your Excel file), rather than the primary (your Access file).

    Explain why 5-minute auto-refreshes are needed? I suggest putting Refresh commands in the control of the user. And have error checking, so that if an error occurs, the User knows it. That's one of the downfalls of timed intervals. You would write errors to a log and maybe fire off email alerts, and avoid cascading failures. And how does the user actually know the data is valid, in a scenario where ETL errors are not reported to them in real time.
     
    #5 heypartner, Mar 26, 2011
    Last edited: Mar 26, 2011
  6. ScriboErgoSum

    ScriboErgoSum Member
    Supporting Member

    Joined:
    Aug 5, 2002
    Messages:
    3,149
    Likes Received:
    387
    Good call. You can easily set up a Refresh button, and you can also set it up to Refresh automatically every time the file is opened. That's what I do for all of our reports at work. They're automatically updated when they open, and the users can filter and update as often they want with a button click.
     

Share This Page