View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
[email protected] jan120253@gmail.com is offline
external usenet poster
 
Posts: 40
Default My code stops working

Hi Claus

You solution did the trick, so I must have disabled events somehow. I dont know how though, as I only had one workbook open, and it worked initially.

Jan

But thaky your for your effort.

Den torsdag den 9. juni 2016 kl. 12.16.04 UTC+2 skrev Claus Busch:
Hi Jan,

Am Thu, 9 Jun 2016 03:01:34 -0700 (PDT) schrieb
No other code in the workbook. But now that I tink about it, I have experience similar problems before, with other events. It seems that the event handler simply stops working from time to time.


the events can also be disabled from another workbook you worked with.
Copy following code in a module and run it:

Sub EventsOn()
Application.EnableEvents = True
End Sub

If you disable events in your code use an error handler to make sure
that the events are enabled if you run into an error, e.g.:
Sub Test()
Application.EnableEvents = False
On Error GoTo CleanUp
'Your code

CleanUp:
Application.EnableEvents = True
End Sub


Regards
Claus B.
--
Windows10
Office 2016