Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheet calculate repeatedly calling itself
Application.EnableEvents would disable events from firing. From the code
shown, it is impossible to diagnose why you might be getting unexpected results. However, once Q1 takes on the value of 1, everytime there is a calculation, you will fire the Add_new_record macro. If you are trying to react to a DDE update, then try using SetlinkonData which is a property of the Workbook object. -- Regards, Tom Ogilvy "CraigB" wrote in message ... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
CALLING MACROS FROM A NEW WORKSHEET | Excel Discussion (Misc queries) | |||
calling macros from worksheet to another | Excel Discussion (Misc queries) | |||
Print a worksheet repeatedly with each list cell | Excel Discussion (Misc queries) | |||
calling up information from a different worksheet. | Excel Worksheet Functions | |||
Calling a macro in another worksheet | Excel Programming |