Worksheet_BeforeDoubleClick Stops Working

M

Minitman

Greetings,

I have a Worksheet_BeforeDoubleClick event looking if I have double
clicked either column A or C and then reacts accordingly. Double
clicking on column A opens up a UserForm. Double clicking on column C
opens a new workbook to print chosen record

Both of these operations work fine until I change some code in a
UserForm. For some reason, when I go to test the changes I made to
some of the controls on that UserForm, the Worksheet_BeforeDoubleClick
event doesn't fire on either column!!!

If I save changes then close and reopen this workbook, then
Worksheet_BeforeDoubleClick is working again.

Any ideas as to what could cause this problem? It is really getting
annoying.

Any help would be appreciated.

-Minitman
 
P

Peter T

Maybe your code disables events and doesn't reset. In the Immediate window
(ctrl-g).

?application.EnableEvents

and hit enter

Regards,
Peter T
 
M

Minitman

Hey Peter,

Thanks. It was when you mentioned EnableEvents that I realized, what
was happening.

It was when the code changes that I was testing failed and I was
thrown out of vba (without the enable events being switched back to
true) that this problem occurs. The only way I know of to fix this is
to reset the event handler back to default by closing and reopening
the workbook.

I'll have to be more careful. :^}

Minitman
 
P

Peter T

The only way I know of to fix this is
to reset the event handler back to default by closing and reopening
the workbook.

application.EnableEvents = true

Just leave the above in the immediate window throughout your session. When
in doubt as to the state of EnableEvents put the cursor after 'true' and hit
enter.

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top