Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Luz Luz is offline
external usenet poster
 
Posts: 2
Default Sheet.Calculate limits??


Hello,
I have a macro that does the following (Excel 2000):
Sheets("MySheet").select
ActiveSheet.EnableCalculation = False

<Write 1000's of v-lookup formulas in sheet
<e.g. i have one instance with ~ 12000 formulas

ActiveSheet.EnableCalculation = True
ActiveSheet.Calculate

<Overwrite all formulas with values through copy &
paste-values commands...


The problem: the last 20-30 rows (about 400-600 formulas)
do not calculate before the code proceeds with the
overwrite.
How can this happen?
How can it be fixed?

Thanks,
Luz


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sheet.Calculate limits??

Strange. This happens when connecting Excel to external applications bu
I have not come across this problem. The macro runs faster than th
application can complete the process.

A fix is supposed to be to add the line
DoEvents
in your case, after the calculate command, but I have never found thi
to work very well - so, in addition, ("belt and braces") I add a Wai
command to stop the macro working for a few seconds, tweaking th
amount of time to suit. eg. 4 seconds
Application.Wait Now + TimeValue("00:00:04")

Hope this helps

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
Luz Luz is offline
external usenet poster
 
Posts: 2
Default Sheet.Calculate limits??

Thanks very much!
My program does not interact with any other applications,
so I have been quite puzzled by this. I thought about the
wait command, but though I'd ask to see if there was
something better. I guess not... But the DoEvents is a
new one for me and so I'll try it. Thanks so much!
Luz


-----Original Message-----
Strange. This happens when connecting Excel to external

applications but
I have not come across this problem. The macro runs

faster than the
application can complete the process.

A fix is supposed to be to add the line
DoEvents
in your case, after the calculate command, but I have

never found this
to work very well - so, in addition, ("belt and braces")

I add a Wait
command to stop the macro working for a few seconds,

tweaking the
amount of time to suit. eg. 4 seconds
Application.Wait Now + TimeValue("00:00:04")

Hope this helps.


---
Message posted from http://www.ExcelForum.com/

.

Reply
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
Cross-sheet dependencies (smart recalc limits) Thinqer Excel Discussion (Misc queries) 0 March 29th 10 10:41 AM
SUM 3D Reference using variable sheet limits Loge Excel Worksheet Functions 6 December 31st 08 08:14 AM
F9 vs. Calculate Sheet No Name Excel Worksheet Functions 3 May 11th 07 09:38 PM
VLOOKUPS: Limits on # per sheet? Trey Excel Discussion (Misc queries) 2 March 16th 06 03:19 AM
Using UsedRange as limits in a For Each loop but for cells on another sheet ? tur13o Excel Programming 2 October 23rd 03 01:18 PM


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

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"