+ Reply to Thread
Results 1 to 6 of 6

Workbook_Activate not triggering

Hybrid View

donwb Workbook_Activate not... 12-10-2018, 10:16 AM
yeon Re: Workbook_Activate not... 12-10-2018, 10:51 AM
6StringJazzer Re: Workbook_Activate not... 12-10-2018, 10:54 AM
romperstomper Re: Workbook_Activate not... 12-10-2018, 11:17 AM
donwb Re: Workbook_Activate not... 12-10-2018, 01:22 PM
romperstomper Re: Workbook_Activate not... 12-10-2018, 05:58 PM
  1. #1
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    98

    Workbook_Activate not triggering

    Excel 2003 VBA
    I have 2 workbooks open.
    If I close one, should "Worksheet_Activate" trigger on the other?

  2. #2
    Registered User
    Join Date
    12-10-2018
    Location
    australia
    MS-Off Ver
    2016
    Posts
    3

    Re: Workbook_Activate not triggering

    No, only if that window has focus. eg: if you had a browser open and your workbook is behind it.

    Just try a test;
    Private Sub Workbook_Activate()
        MsgBox "activated"
    End Sub
    Last edited by yeon; 12-10-2018 at 10:52 AM. Reason: typo

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,792

    Re: Workbook_Activate not triggering

    I don't think so. Only if you actually activate the other one. I don't think it becomes active by default. Does it trigger if you click on something in the remaining workbook?

    I am five versions past Excel 2003 so I can't test it.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,978

    Re: Workbook_Activate not triggering

    Your title says Workbook_Activate but your post says Worksheet_Activate - which one do you mean? The former should be triggered, the latter not.
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Workbook_Activate not triggering

    My mistake
    I meant Worksheet_Activate.
    But I have found the problem - I found an instruction "Application.EnableEvents = False" lurking in the code.
    Deleted it - now it triggers.
    Sorry for the trouble.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,978

    Re: Workbook_Activate not triggering

    A Worksheet_Activate event should only be triggered by switching sheets in the same workbook. Switching between workbooks by any method should not trigger it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Disabling workbook_deactivate and workbook_activate from firing alltogether
    By MrsAlice in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2012, 12:59 AM
  2. [SOLVED] Workbook_activate or workbook_open?
    By Lv27 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2012, 05:23 AM
  3. Triggering Chart
    By excelenergy in forum Excel General
    Replies: 0
    Last Post: 06-08-2012, 10:40 AM
  4. triggering a non volatile UDF()
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-22-2012, 01:03 AM
  5. [SOLVED] Workbook_activate - why doesn't it work
    By Lv27 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2012, 02:50 PM
  6. Workbook_Activate and Workbook_Open
    By caliskier in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2010, 12:49 PM
  7. Triggering UDF
    By bhofsetz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-29-2006, 06:43 PM
  8. Workbook_Activate question
    By Peter Rooney in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-17-2005, 06:25 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