Results 1 to 2 of 2

Open and closing a workbook using On.Time Application

Threaded View

  1. #1
    Registered User
    Join Date
    04-07-2015
    Location
    Kent, Ohio
    MS-Off Ver
    2007
    Posts
    1

    Open and closing a workbook using On.Time Application

    I have a read only workbook that is used on roughly 25 workstations daily. This workbook contains details for all of our customer specs. I update this often sometimes daily as the specs change or new customers are added. This excel file is located on our network drive and each work station has a short cut that points to the network drive to launch the read only file. Once the excel file is opened at the work station the user has to enable the macros for the workbook to function properly. In the workbook I have a routine in place that runs at 5pm to close the workbook and then reopen it. It works as it should on the day the file is opened but come the next day at 5pm it doesn't run the routine again. I think it has something do with killing the timer but I am not sure. Any and all help would be appreciated. I have copied the code below, most of this I found on the web!

    What I am trying to acheive is to have the most current information at all of our workstations without having to personaly go around to close and reopen the excel file or to count on everybody doing it everyday.


    Thisworkbook

    Private Sub Workbook_Open()
    
    Application.OnTime TimeValue("17:00:00"), "CloseNoSave"
    
    End Sub
    Module

    Sub CloseNoSave()
    Dim wb As Excel.Workbook
    Set wb = ThisWorkbook
    Dim pth As String
    pth = wb.FullName
    Application.OnTime Now + TimeValue("00:00:10"), Application.Workbooks.Open(pth)
    wb.Close (True)
    End Sub
    Last edited by AmosInOhio; 04-08-2015 at 07:33 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Closing a workbook if someone has it open
    By cedric9996 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-11-2014, 06:07 PM
  2. Open a workbook off my desktop then closing current workbook
    By superchew in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-18-2013, 03:34 PM
  3. open userform when closing workbook > help
    By step_one in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-22-2011, 12:46 AM
  4. [SOLVED] Closing an open workbook
    By Dan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2006, 04:00 AM
  5. Stopping Application OnTIme when closing a workbook
    By L2B in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2005, 10:20 AM

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