+ Reply to Thread
Results 1 to 3 of 3

VBA to Close Workbook if BOTH Workbook is inactive and VBA is Not Open

  1. #1
    Registered User
    Join Date
    01-30-2013
    Location
    Hartford
    MS-Off Ver
    Microsoft Office 2007
    Posts
    3

    VBA to Close Workbook if BOTH Workbook is inactive and VBA is Not Open

    I have been searching high and low, but apparently nobody else has this need. I built an excel file for the department at my company that is accessed frequently by a few users. The file is still currently in development, so I need to regularly access the file for updates/maintanance. I am the only one that ever does any work in VBA, but the other users are notorious for opening the file and leaving their desk for hours at a time. I know how to implement an auto close/save routine if X amount of time has passed, however, it will still close even if I am working in VBA, which I, obviously, don't want. Any suggestions?

    Another option I considered was implementing an
    Please Login or Register  to view this content.
    But I don't know the correct syntax (if it exists) to do that and I have had no luck finding any threads that detail how to tell if VBA is open or not.

    Thanks.

    EDIT: Figured out a work around. I added this if statement:
    Please Login or Register  to view this content.
    Last edited by teblowtime; 05-23-2013 at 12:31 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: VBA to Close Workbook if BOTH Workbook is inactive and VBA is Not Open

    Why not stop/suspend the auto close/save code while you are working with the file?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-30-2013
    Location
    Hartford
    MS-Off Ver
    Microsoft Office 2007
    Posts
    3

    Re: VBA to Close Workbook if BOTH Workbook is inactive and VBA is Not Open

    I guess I could do that. I kind of just wanted something automatic so I didn't have to remember to suspend it and re-implement it every time I open and close. I know I'll forget to re-implement it. Haha.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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