Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Ankeny, Iowa, USA
    Posts
    344
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Macro to Automatically Email Excel WS (Excel 2002)

    Hi,
    Is there a way to have an Excel worksheet automatically open, refresh, then email itself at midnight every night, or at midnight on Sunday nights? I'm mostly interested in the automatically opening at midnight thing, as I have code to refresh ms queries, pivot tables, and to email. Any help is appreciated, as always!!
    Thanks!
    Lana

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Macro to Automatically Email Excel WS (Excel 2002)

    <P ID="edit" class=small>(Edited by sdckapr on 02-Dec-08 13:02. Added PS for where the Scheduler can be found)</P>You could create a workbook that had code in the workbook open event to:
    Open up the desired workbook
    and do whatever (refresh, save, email, etc)
    The close that workbook
    Then close and quit excel

    [Having it in a separate workbook, allows using the other workbook during the day withou worrying about the code to do all the other stuff).

    You can use the WIndows Scheduler to run at midnight and open up that particular workbook to start the process. This would not require XL to be running some timebased code continually to check the time and causing sluggishness. The windows scheduler would use less overhead...

    Steve
    In my Win XP the scheduler is found at Start - Programs - Accessories - system tools - scheduled tasks

  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Ankeny, Iowa, USA
    Posts
    344
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: Macro to Automatically Email Excel WS (Excel 2002)

    I like this option... I will give it a try!
    Thanks Steve!
    Lana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •