Results 1 to 6 of 6

Workbook_activate - why doesn't it work

Threaded View

Lv27 Workbook_activate - why... 05-01-2012, 06:53 AM
marreco Re: Workbook_activate - why... 05-01-2012, 07:11 AM
TMS Re: Workbook_activate - why... 05-01-2012, 07:15 AM
Lv27 Re: Workbook_activate - why... 05-01-2012, 07:30 AM
TMS Re: Workbook_activate - why... 05-01-2012, 09:12 AM
Lv27 Re: Workbook_activate - why... 05-07-2012, 02:50 PM
  1. #1
    Registered User
    Join Date
    05-01-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    85

    Workbook_activate - why doesn't it work

    I put this in the "Workbook":

    Private Sub workbook_activate()
    alertTime = Now + TimeValue("00:00:10") 'delay for open indtil execute macro
    closingTime = Now + TimeValue("00:00:15") 'delay fra open til close
    Application.OnTime alertTime, "EventMacro"
    
    If TimeSerial(6, 0, 0) < Now And TimeSerial(8, 0, 0) > Now Then
    Application.OnTime closingTime, "CloseMacro"
    End If
    End Sub
    
    Private Sub EventMacro()
    Range("a500000").End(xlUp).Select
    
    End Sub
    
    Private Sub CloseMacro()
    With ThisWorkbook
    .Save
    .Close
    End With
    End Sub


    -- But is says that "EventMacro" cannot run? Can anyone help me out?
    Last edited by Lv27; 05-07-2012 at 02:49 PM.

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