Results 1 to 2 of 2

New to Excel Forum. Working on timed autosave worksheets.

Threaded View

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    Amarillo, Texas
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    2

    New to Excel Forum. Working on timed autosave worksheets.

    Found a nice post about exactly what to do but when I save the workbook, I get compiler error.

    I placed this in the Workbook section:
    Private Sub Workbook_Open()
    
        StartTimer
    
       End Sub
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    
        StopTimer
    
    End Sub
    and this in the General:

    Option Explicit
    Public RunTime
    Sub StartTimer()
        RunTime = Now + #12:05:00 AM#
        Application.OnTime RunTime, "SaveBook", schedule:=True
    End Sub
    Sub SaveBook()
        ActiveWorkbook.Save
        StartTimer
    End Sub
    Sub StopTimer()
        On Error Resume Next
        Application.OnTime RunTime, "SaveBook", schedule:=False
    End Sub
    When I save the workbook, I get a highlight on StartTimer in the Private Sub Workbook_Open() and it says Compile error:
    Sub or Function not defined

    Any help would be appreciated.

    Wayne
    Last edited by arlu1201; 07-09-2013 at 01:41 AM. Reason: Use code tags in future.

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