+ Reply to Thread
Results 1 to 2 of 2

Timer , code to check IF worksheet is open else Close it. ??

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Zutphen
    MS-Off Ver
    Excel 2003
    Posts
    56

    Timer , code to check IF worksheet is open else Close it. ??

    Hello,

    On my userform i have an OK button and a Refresh userform button , and an Userform initialize.
    When somebody has entered all the data they press the OK button and it all the data enters on a worksheet. Then it closes.
    Because of this..
    Please Login or Register  to view this content.
    I also have a timer which closes it if there is no activity.
    Please Login or Register  to view this content.
    And i have a Update refresh button.
    Please Login or Register  to view this content.
    And last but not least , on initialize it opens the file again.
    Please Login or Register  to view this content.
    The problem: Many times because of the timer or OK button it tries to close the file while there is no file open which gives an ERROR.
    Or the person presses Update/refresh before the file is closed and then the userform initializes and tries to open the file again which causes the error , or popup : This file already open are you sure blablalbla.

    Solution : A way to check if workbook is open else close it. I tried: If WorkbookIsOpen then Workbook(name.xls).close true
    but cannot figure out how to do it.
    Last edited by stevnb; 12-07-2012 at 06:43 AM.

  2. #2
    Registered User
    Join Date
    11-05-2012
    Location
    Zutphen
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Timer , code to check IF worksheet is open else Close it. ??

    I have found the solution myself.

    Please Login or Register  to view this content.

+ 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