+ Reply to Thread
Results 1 to 9 of 9

Shutdown Macro

  1. #1
    Registered User
    Join Date
    01-10-2008
    Posts
    16

    Shutdown Macro

    I have an auto shutdown macro (recommended on here ) that runs after 15 mins and closes the sheet if no info has been added.

    It opens a new workbook and creates a message to tell the user whats happened.

    It is working properly except it, on occasion, after the worksheet has closed seems to randomly reopen the sheet and perform the closedown again.

    Anyone have any ideas why this may happen?

    Thanks in advance.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by suss-hmfc
    I have an auto shutdown macro (recommended on here ) that runs after 15 mins and closes the sheet if no info has been added.

    It opens a new workbook and creates a message to tell the user whats happened.

    It is working properly except it, on occasion, after the worksheet has closed seems to randomly reopen the sheet and perform the closedown again.

    Anyone have any ideas why this may happen?

    Thanks in advance.
    It would be better if you could post the macro here so that we can take a look. The terminology is a little confusing. You can close a workbook but not a sheet. I guess that's what you mean, but I am guessing.

    Since the macro can only run when the workbook is open in memory, it seems unlikely that the workbook has indeed been closed. Or perhaps it's not the macro in the workbook you've closed that's running, but one in say your Personal Workbook or perhaps some other.

    Rgds

  3. #3
    Registered User
    Join Date
    01-10-2008
    Posts
    16
    Public close Down Module

    Please Login or Register  to view this content.
    Standard Module
    Please Login or Register  to view this content.

    From This Workbook
    Please Login or Register  to view this content.
    Sorry yes i meant close down the workbook.

    It seems to re open and then close the sheet again running the newsheet macro and leaving the newly created sheet (as well as any previously generated) I think its re opening and closing in reference to the shutdown clock, i.e. if you have it set to 11 mins, 11 mins after closing it opens, closes and creates another newsheet (from the newsheet macro)

    thanks

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Macro set to run at a future time
    The workbook containg the macro is closed
    The instance of Excel that was used to setup the future macro run time is still open

    With the above conditions when the alloted macro run time is reached Excel will open the closed workbook & run the macro
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  5. #5
    Registered User
    Join Date
    01-10-2008
    Posts
    16
    Quote Originally Posted by mudraker
    Macro set to run at a future time
    The workbook containg the macro is closed
    The instance of Excel that was used to setup the future macro run time is still open

    With the above conditions when the alloted macro run time is reached Excel will open the closed workbook & run the macro
    Any idea how to stop this?

    Should

  6. #6
    Registered User
    Join Date
    01-10-2008
    Posts
    16
    Quote Originally Posted by mudraker
    Macro set to run at a future time
    The workbook containg the macro is closed
    The instance of Excel that was used to setup the future macro run time is still open

    With the above conditions when the alloted macro run time is reached Excel will open the closed workbook & run the macro
    Any idea how to stop it happening, really annoying.

    Would shutting down excel work

    i.e. somehow, instead of opening a new workbook, open a new version of excel and then create the workbook and have the original instance of excel close?

    is this even possible?
    Last edited by suss-hmfc; 04-22-2008 at 08:11 AM.

  7. #7
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    try these commands

    Please Login or Register  to view this content.
    Not sure what you mean by create a new workbook

  8. #8
    Registered User
    Join Date
    01-10-2008
    Posts
    16
    There another way to open excel.

    the IT dept does not have excel on the c drives so cant access the path?

  9. #9
    Registered User
    Join Date
    01-10-2008
    Posts
    16
    Ok, got the path so ignore above.

    NOW!

    the problem is, it opens the new copy of excel, (GREAT!) but the remainder of the macro tries to (obviously) run in the old copy.

    i.e.
    copy 1 calls and opens copy 2 but copy 2 is seperate so the macro continues to run in copy 1, whereas i want the formatting etc to happen in the new copy of excel.
    (hope that reads correctly)

    Please Login or Register  to view this content.
    Or, is there a way to combine the
    Please Login or Register  to view this content.
    with an open file command? So when opening the new copy of excel as part of the opening it then opens a specific file?

    Thoughts please.
    Last edited by suss-hmfc; 04-22-2008 at 10:16 AM.

+ 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