+ Reply to Thread
Results 1 to 6 of 6

Need help with enabling events

  1. #1
    Registered User
    Join Date
    10-10-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2010
    Posts
    50

    Need help with enabling events

    Hi,

    I was provided code by LJMetzger which I think originated from Andy Pope.

    I modified it to handle more than just text boxes. There is a class module called ClassEvents which is supposed to handle Change, Dbl Click, etc. f

    In my module I have (and this works)!:

    Please Login or Register  to view this content.
    and (this following bit that is giving me trouble):

    Please Login or Register  to view this content.
    but my Events are not working. Here is the contents of the ClassEvents:

    Please Login or Register  to view this content.
    I added the call to build the control (just one), and enable the control for testing purposes:

    Please Login or Register  to view this content.
    to ThisWorksheet. I tried TextBox and ComboBox; neither works, yet in the sample LJMetzger sent; it does. I get no errors. Anyone have any idea what I'm doing wrong?

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,309

    Re: Need help with enabling events

    I imagine the problem is that you are adding ActiveX controls at runtime which will reset your project and destroy your myCtrlEvents variable (which I assume is declared somewhere appropriate). You need to call the EnableEvents sub using Application.Ontime.
    Anyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    10-10-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Need help with enabling events

    You're right, I removed the call, and then called EnableEvents manually by calling the macro and it worked.

    I replaced the EnableEvents call I had with:

    go = ActiveSheet.OnTime(Now + TimeValue("00:00:03"), "Module1.EnableEvents")

    and I get an "Object doesn't support this property or method" error. What am I doing wrong?

    I'm trying to create them then add events to them to enable the interaction I need. Almost there. Thanks

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

    Re: Need help with enabling events

    Application.ontime rather than activesheet.

  5. #5
    Registered User
    Join Date
    10-10-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Need help with enabling events

    I had that. I get an "Expected Function or Variable" compile error. BTW, my combox boxes are not working (no events).

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

    Re: Need help with enabling events

    Please Login or Register  to view this content.

+ 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. Enabling Macros
    By ggordonstewart in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-12-2010, 12:02 AM
  2. Excel 2007 : Enabling Macros
    By mckev200 in forum Excel General
    Replies: 3
    Last Post: 04-15-2009, 04:31 PM
  3. Enabling Events
    By Robin Clay in forum Excel General
    Replies: 9
    Last Post: 07-12-2006, 10:10 AM
  4. do events? background events
    By cereldine in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2006, 08:10 AM
  5. [SOLVED] enabling chart events for an embedded chart
    By Wazooli in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2006, 09:20 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