LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default calculationstate

Maybe try

Application.EnableEvents = False
Application.Calculate
Application.EnableEvents = True


"Kris" wrote:

Tom Ogilvy wrote:
to the best of my knowledge, Calculate doesn't operate asynchronously, so it
shouldn't be an issue.


When I put break after calculate and I look at call stack I have


vbaproject.sheet1.worksheet.change
<non basic code
vbaproject.udf.myfun


udf is my module

it means that myfun which is a udf function was called by excel from one
of cells, this function was interrupted by excel and my code in
worksheet_change event is continued.
When worksheet_change is finished excel goes back and finishes calculation.

But I can't continue worksheet_change without calculated values in cells.








If it is for some reason, then break your code into two pieces (calculate at
the end of the first). Then use Application.OnTime to start the second
section of code with an appropriate delay.


Calculation time is now 5 seconds, I can't add any second more.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop until Calculationstate = xldone Tornados[_4_] Excel Programming 0 September 28th 04 12:48 PM
Stop until Calculationstate = xldone Tornados[_3_] Excel Programming 1 September 28th 04 12:18 PM


All times are GMT +1. The time now is 02:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"