+ Reply to Thread
Results 1 to 2 of 2

Dynamically assigned event handlers disappear

  1. #1
    Registered User
    Join Date
    11-06-2015
    Location
    São Paulo
    MS-Off Ver
    2013
    Posts
    1

    Dynamically assigned event handlers disappear

    Hi.

    I'm trying to build a dynamic form and I'm facing some troubles assigning events to the created elements.

    Basically once the user clicks a checkbox previowsly created the program creates a lot of fields for information input and the checkbox to enable the next line of information in the form (if the checkbox is clicked the program will repeat the process of creating the fields).

    Everytime I create a new checkbox I assign an event handler to it, just as follows:

    MODULE SUB:

    Please Login or Register  to view this content.
    CLASS MODULE:

    Please Login or Register  to view this content.
    The problem is: When I create a checkbox, the previows checkbox stops responding to the _Change event and the class sub is not called anymore.
    Is there something missing in my code?

    Thanks a lot.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Dynamically assigned event handlers disappear

    Hi,

    I'm not a Class Expert. Generally when I use Classes, I follow cookbook instructions from someone else. Such is the case with the file associated with post #3 in the following thread: http://www.excelforum.com/excel-prog...ml#post4169003

    The file uses a Class Event handler for both static and dynamic UserForm Checkboxes.

    Please note that in the future, you will get a better and quicker response if you upload a sample workbook.
    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Lewis

+ 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] Dynamically catch any click event
    By SocratesJC in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 10-06-2015, 09:02 PM
  2. AddingControls and event handlers RUNTIME
    By Ahkio in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-17-2015, 08:32 PM
  3. [SOLVED] Dynamic Controls with event handlers
    By stuart010 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2012, 11:43 AM
  4. (Closed)Dynamic Userform Controls With Event Handlers
    By stuart010 in forum Excel General
    Replies: 0
    Last Post: 04-30-2012, 11:32 AM
  5. Dynamically add pop up combo box with a click event
    By dovee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2008, 12:27 PM
  6. Run-Time Error 91 When Dynamically Creating Controls and Event Handlers
    By chucklod in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-21-2008, 05:47 PM
  7. [SOLVED] Further Clarification with Event Handlers & Class Modules
    By Kevin H. Stecyk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2005, 02:06 PM

Tags for this Thread

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