+ Reply to Thread
Results 1 to 4 of 4

Custom Object ?Resursive? Events

  1. #1
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Custom Object ?Resursive? Events

    I have a custom userform Control, clsTwoInput.

    Basically, it is a Frame that contains a CheckBox and two InputBoxes.
    The CheckBox toggles the visibility of the InputBoxes and the clsTwoInput.Value is the .Value of the visible InputBox.

    Each of the InputBoxes is either a TextBox or a clsTwoInput.

    This works fine, until I try to get the clsTwoInput to generate a Change event.

    Here is my current clsTwoInput code.
    When I try to add WithEvents to the declaration of clOneInput, I get an compile error "Cannot handle events for the object specified"
    Please Login or Register  to view this content.
    In the attached user form, OuterInput is a clsTwoInput that has its checkbox, one text box and one clsTwoInput, InnerBox.
    Changing OuterInput by clicking the checkbox or by typing into the checkbox will trigger the OuterInput_Change event, but changing InnerBox will not.

    Is there a way for a custom object, that has a different instance of that object as a property of that object, to receive Events from the sub-instance of itself?

    Cross posted
    http://www.vbaexpress.com/forum/show...rential-Events
    Last edited by mikerickson; 07-26-2015 at 07:34 PM.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Custom Object ?Resursive? Events

    Hi Mike,

    Is/are the userforms Modal or Modeless? I think this will make a difference.

    http://www.bettersolutions.com/vba/V...E846743531.htm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Custom Object ?Resursive? Events

    I'm on a mac and therefore modal.

    The issue seems to be that, although the instances that I'm creating don't reference themselves, the modules used to create those instances do have a circular dependencies of Events. Excel is seeing module level circular references and giving me a Compile Error.


    Also, I had some problems with this board's interface earlier, wan't sure if it had posted, so I cross-posted at
    http://www.vbaexpress.com/forum/show...rential-Events
    Last edited by mikerickson; 07-26-2015 at 07:38 PM.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Custom Object ?Resursive? Events

    A solution has been found in the other site's thread. So I'll mark this solved.

    Thanks for all your input.

+ 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. moving chart object and keep object ability for chart events?
    By tdrose01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2014, 06:43 AM
  2. Adding code to events of a control object on-the-fly
    By Mervil in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-29-2010, 02:22 PM
  3. custom events
    By SuitedAces in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-18-2007, 08:46 AM
  4. Shapes object events?
    By Dr.Ile in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-07-2006, 07:10 AM
  5. object does not source automation events
    By josh7 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-21-2005, 03:05 PM
  6. [SOLVED] Using Events with the Application Object & XL 2003
    By Kevin H. Stecyk in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-25-2005, 01:06 PM
  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