Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Piscataway, New Jersey, USA
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts

    click event not firing (Excel 2003 XP)

    Hi everybody:

    This is weird. I have a spreadsheet with 3 controls on it: a command button, a checkbox, and a combo box.
    The user makes a selection from the combo box, which fires a routine on its lost focus event. I am using that event in place of the Change event, because I only want the code to run once. Then, the user checks (or doesn't ) the check box and clicks the button, which calls another routine on its click event that creates a pivot table report.

    Or used to, until today! As of this morning (Monday, Monday!) the click event does not fire. The combo lost focus code runs fine when the user clicks the button, but the button code doesn't run. It's not the code; the button won't even give me a "click" message box.

    Anyone ever experienced anything similar? Any ideas how to work around it? I'm wondering what could cause this peculiar behavior; activating another sheet?
    I don't want to call the click event procedure at the end of the lostfocus code, because the user may not actually elect to run the pivot report at that point.

    Thank you, in advance, for your help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: click event not firing (Excel 2003 XP)

    What happens if you double-click the command button while in design mode? Does that take you to the On Click event procedure?

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Piscataway, New Jersey, USA
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: click event not firing (Excel 2003 XP)

    Hi Hans:

    No, I tried that. Same problem.

    I figured it out - the lostfocus routine activated another worksheet, and that appears to have confused Excel into disregarding the click event from the button on the first sheet. I rewrote my lostfocus code to avoid activating the second worksheet, and now the click event is firing fine.

    What I don't understand is why this wasn't a problem last week.

    Thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •