+ Reply to Thread
Results 1 to 5 of 5

workbook won't close when other workbooks are open

  1. #1
    Registered User
    Join Date
    07-24-2015
    Location
    Toledo, OH
    MS-Off Ver
    Microsoft Office 2010
    Posts
    85

    workbook won't close when other workbooks are open

    I have a workbook that refuses to close if any other workbooks are open at the same time. This workbook has a running clock in it. Here are the macros that run this clock:

    Please Login or Register  to view this content.
    I got this code online and I frankly don't really understand how it works, but it keeps a clock ticking steadily on one of the spreadsheets, and I need it to continue doing this. But now, when there are other workbooks open, this workbook will not close. Not only that, but if I try to close it, it runs through the code in the Workbook_Open sub! Thoughts? Is there another way to run a clock in a workbook that I could try instead? Is there a loop somewhere in here that I'm not closing correctly? Help, please!

  2. #2
    Registered User
    Join Date
    02-26-2016
    Location
    Wisconsin, USA
    MS-Off Ver
    2013, 2016
    Posts
    33

    Re: workbook won't close when other workbooks are open

    Found the answer here: http://stackoverflow.com/questions/2...ication-ontime

    Your modified module code is below. Nothing changed in ThisWorkbook.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-24-2015
    Location
    Toledo, OH
    MS-Off Ver
    Microsoft Office 2010
    Posts
    85

    Re: workbook won't close when other workbooks are open

    I tried these changes. The clock works fine, but the workbook still won't close if another workbook is open. If it is the only workbook open, it closes just fine, but I can't ask the people using this workbook to close all other workbooks before closing this one.

  4. #4
    Registered User
    Join Date
    02-26-2016
    Location
    Wisconsin, USA
    MS-Off Ver
    2013, 2016
    Posts
    33

    Re: workbook won't close when other workbooks are open

    It works for my computer, so I thought it should be fine for you. Try replacing this code to add a delay before closing the book:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-24-2015
    Location
    Toledo, OH
    MS-Off Ver
    Microsoft Office 2010
    Posts
    85

    Re: workbook won't close when other workbooks are open

    That worked. Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy from first workbook, close open new workbook paste close
    By johncarr1952 in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 08-04-2021, 08:50 AM
  2. [SOLVED] How can I completely close a specific workbook without closing other open workbooks
    By Sc0ut in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-07-2016, 04:06 PM
  3. Replies: 0
    Last Post: 08-07-2014, 06:56 PM
  4. [SOLVED] Open workbooks update the main one and close the other workbooks
    By stojko89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2013, 07:12 AM
  5. [SOLVED] Open Multiple Workbooks, Record names, Copy paste to Active Workbook, Close the Workbooks
    By vba_madness in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2013, 06:09 AM
  6. How to close open workbooks from an application get open filename call ?
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2011, 10:41 PM
  7. Save an open workbook, then open template workbook and close the saved workbook
    By ondvirg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2009, 10:20 PM

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