+ Reply to Thread
Results 1 to 6 of 6

Schedule Macro

  1. #1
    Registered User
    Join Date
    03-08-2007
    Posts
    15

    Schedule Macro

    i wrote a macro. i want to schedule this macro on some specific time
    like morning at 5:00 A.M daily .like daily it wil run the given time period
    plz tell me how wil i schedule that xls file so it wil automatically open
    and run the macro written in that xls file
    Pls Help me
    Last edited by Juw; 03-13-2007 at 02:20 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Juw,

    This is a 2 part procedure. You need to set the Workbook up and the then schedule it to be run.

    Workbook Setup:
    1. A call to your macro must be placed in the Workbook_Open event procedure.
    2. After your macro finishes the Workbook must be Closed.

    Scheduling a Task:
    1. Click on "Start" and open the Control Panel.
    2. Double Click on "Scheduled Tasks".
    3. Click File > New >Scheduled Task.
    4. In the list you will see "New Task" highlighted. Start typing to rename "New Task" to describe what this task does.
    5. Click on File > Properties. This will bring up a dialog with 3 tabs: Task, Schedule, and Settings.
    6. The Task tab setups the file to run. In your case the workbook. You can use the browse button to enter the full path and file name automatically.
    7. The Schedule tab allows you to setup when the task is run.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    03-08-2007
    Posts
    15
    Thanku so much

  4. #4
    Registered User
    Join Date
    03-08-2007
    Posts
    15
    every time i will open this workbook the macro will be restarted
    i want only in the morning when the time is specified in the schedule task.
    dont want to run the macro again and again ever time the workbook is open
    wat should i do to run the macro at once

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Juw,

    Use this line of code in the Workbook_Open() event procedure to run the macro only between 5:00 and 5:10 AM. Just change MyMacro to the name of your macro.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross
    Last edited by Leith Ross; 03-13-2007 at 05:34 AM.

  6. #6
    Registered User
    Join Date
    11-09-2006
    Location
    Kansas, USA
    MS-Off Ver
    2013
    Posts
    76
    Thanks, just what I was looking for.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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