+ Reply to Thread
Results 1 to 3 of 3

Worksheet Change Event Not Firing / Worksheet Calculate Repetitive Firing

  1. #1
    Registered User
    Join Date
    09-08-2017
    Location
    Houston, Texas
    MS-Off Ver
    2010, 2016
    Posts
    34

    Worksheet Change Event Not Firing / Worksheet Calculate Repetitive Firing

    Good afternoon, All!

    I have a worksheet that utilizes SAP Office for Analysis. The add-in has a refresh button that refreshes the data source connected and updates the crosstab accordingly. I have a macro adjacent to the crosstab which should fire on worksheet change but it's not firing since Excel doesn't detect the changes. I've tested on worksheet calculate and it does fire it but it my sub gets called indefinitely. I would like to avoid creating a refresh button for users to fire my sub, but I'd like your inputs before I do. The two columns that should fire the sub would be column L or G.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,497

    Re: Worksheet Change Event Not Firing / Worksheet Calculate Repetitive Firing

    In a Change Event handler, Target is a range provided to you by the event handler ... the range that has been changed.

    That's not what's happening in your Calculate event. You define/Dim a Target Range and set it it to Range("L:L") and then compare that Target Range to Range("L:L") using Intersect. Well, it is going to Intersect because you’ve just set it. You then call a routine that makes changes in the workbook, probably causing a recalculation and making your "always true" comparison. Hence the loop.

    How does SAP provide updates to the worksheet? A Change Event handler will not fire if the range/cell(s) being monitored contains a formula/formulae. Your change event handler is only monitoring column G, not L and G.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-08-2017
    Location
    Houston, Texas
    MS-Off Ver
    2010, 2016
    Posts
    34

    Re: Worksheet Change Event Not Firing / Worksheet Calculate Repetitive Firing

    It provides just a flat table with no formulas. There's a button that does a callback to SAP service: Application.Run("SAPExecuteCommand", "Refresh", "DS_1")

    The interesting thing is that when the table expands or contracts my actual rows expand and contract too but it doesn't trigger the worksheet change/calculate event.

+ 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] ComboBox_Click event is firing for any change on any worksheet
    By 6StringJazzer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-27-2017, 05:21 PM
  2. Deleting Last Table ListRow not firing worksheet change event
    By Tooley in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-24-2017, 12:00 PM
  3. [SOLVED] How to check if a sheet is active before firing the worksheet change event
    By jrtraylor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2016, 03:28 PM
  4. [SOLVED] Custom function not firing when a change to the workbook/worksheet has been done
    By thechazm in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-16-2013, 10:20 AM
  5. [SOLVED] Worksheet Change not firing
    By rachel.dudley in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-27-2013, 07:14 AM
  6. worksheet change not always firing
    By martindwilson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2009, 08:14 PM
  7. Worksheet Selection Change event not firing??
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2006, 10:29 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