View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
CraigB[_2_] CraigB[_2_] is offline
external usenet poster
 
Posts: 6
Default worksheet calculate repeatedly calling itself

I've found out that worksheet change will not pick up when my cell changes
(the cell is linked by DDE to another application). So I'm picking up the
change using worksheet calculate, but the procedure is repeatedly calling
itself, despite me using Application.EnableEvents to disable the events
during the procedure. Add_new_record is the procedure that keeps being
repeated, but I only want it to run once. Any ideas? Here is the code;

Sub Worksheet_Calculate()
If Range("Q1").Value = "1" Then
Application.EnableEvents = False
Add_new_record
End If
Application.EnableEvents = True
End Sub

Thanks,
Craig.