+ Reply to Thread
Results 1 to 3 of 3

Problem day 2 running a scheduled .xlsm-macro

Hybrid View

svenalgo Problem day 2 running a... 07-31-2012, 03:26 PM
UKNinja Re: Problem day 2 running a... 07-31-2012, 03:40 PM
svenalgo Re: Problem day 2 running a... 08-02-2012, 05:02 AM
  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Vagnhärad, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    2

    Problem day 2 running a scheduled .xlsm-macro

    I have a macro that should run every day at 07.00 o'clock from Windows schedule (Office 2007).
    First day it runs perfect, next day it doesn't run at all.
    If I look in Task Manager I see that EXCEL.EXE is running and
    if I try to open my macro it says that the macro already running,
    opened by myself. After restarting the computer it runs perfect again.
    The first Sub in Modul1 is "Auto_open".
    How to avoid restarting the computer every day?

  2. #2
    Registered User
    Join Date
    07-31-2012
    Location
    Cheshire, England
    MS-Off Ver
    Excel 2010, Excel 2011
    Posts
    10

    Re: Problem day 2 running a scheduled .xlsm-macro

    Hi,

    Reading this it sounds like the scheduled task opens the Excel workbook which triggers the macro stored in the Auto_Open routine to be ran, which means unless you exit the workbook after execution it won't be triggered again.

    Try adding <code>Application.Quit</code> to the very end of the macro which will cause the Excel instance to terminate. The next time the scheduled task runs it will reopen the workbook and refire the macro.

  3. #3
    Registered User
    Join Date
    07-31-2012
    Location
    Vagnhärad, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Problem day 2 running a scheduled .xlsm-macro

    Hi
    I have already added "Application.Quit" as last sentence so the problem is in Windows Schedule
    that not, as I think, close the instance correctly. Anyone that have a tips?!

+ 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