+ Reply to Thread
Results 1 to 2 of 2

Hearing custom events

  1. #1
    Forum Contributor
    Join Date
    02-26-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    173

    Hearing custom events

    I maintain an add-in that needs to create a button on a spreadsheet that emits an event which is heard by an already instantiated class so that cached values can be taken advantage of. I seem to have no issue emitting the event, but it is never heard. I have created an example .xlam that replicates my add-in's core structure.

    Step 1) Trigger RunMacro() to drop the button
    Step 2) Click 'EVENT' button to throw event
    When the event is heard, a message box should appear that says "Event heard: Custom_event_1 Cache is set"

    What am I missing?
    For those who can just look at the code to see what's wrong:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    EDIT

    I added WithEvents to the snippet in this post. I did not change it in the attached .xlsm. Anyone using the .xlsm for their own development will need to add WithEvents to the declaration.
    Attached Files Attached Files
    Last edited by smpita; 01-06-2018 at 02:12 PM. Reason: Added WithEvents to example snippet

  2. #2
    Forum Contributor
    Join Date
    02-26-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    173

    Re: Hearing custom events

    Found it myself.

    In the TestReader Class
    Please Login or Register  to view this content.
    should be
    Please Login or Register  to view this content.
    EDIT

    I have changed this line in the above snippet for easier copypasta. Cheers.
    Last edited by smpita; 01-06-2018 at 02:14 PM.

+ 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. Is it possible Enable one/few events, and disable rest of the events by VBA Excel?
    By hoalahpi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2016, 02:24 AM
  2. [SOLVED] Custom Object ?Resursive? Events
    By mikerickson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2015, 08:03 PM
  3. Custom Object ?Resursive? Events
    By mikerickson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-26-2015, 05:33 PM
  4. Q: OLEObject in custom class, events not firing
    By miguel3d in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-03-2015, 08:45 PM
  5. [SOLVED] Custom Class to replace ThisWorkbook Events?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-14-2014, 02:18 AM
  6. custom events
    By SuitedAces in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-18-2007, 08:46 AM
  7. Shapes and Events and Custom Menue
    By Tom G. in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2005, 03:06 PM

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