ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet_BeforeDoubleClick Stops Working (https://www.excelbanter.com/excel-programming/419751-worksheet_beforedoubleclick-stops-working.html)

Minitman

Worksheet_BeforeDoubleClick Stops Working
 
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



Peter T

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

?application.EnableEvents

and hit enter

Regards,
Peter T

"Minitman" wrote in message
...
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





Minitman

Worksheet_BeforeDoubleClick Stops Working
 
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




On Sun, 9 Nov 2008 20:13:11 -0000, "Peter T" <peter_t@discussions
wrote:

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

?application.EnableEvents

and hit enter

Regards,
Peter T

"Minitman" wrote in message
.. .
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





Peter T

Worksheet_BeforeDoubleClick Stops Working
 
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




"Minitman" wrote in message
...
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




On Sun, 9 Nov 2008 20:13:11 -0000, "Peter T" <peter_t@discussions
wrote:

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

?application.EnableEvents

and hit enter

Regards,
Peter T

"Minitman" wrote in message
. ..
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








All times are GMT +1. The time now is 07:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com