Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel macro freezes

Status
Not open for further replies.

rjvencken

Programmer
Aug 8, 2010
5
NL
VBA-n00b would like to create a file from Excel-sheet through macro. This once worked but now the macro consistently chokes on the 4th record in sheet. Then Task Manager tells me Excel hogs 50% CPU. No idea where to start debugging. Yes I know the code is not well written.

Attached the MS Excel 2003 file (upgrading didn't solve the problem)
 


Hi,

What happens if you put a break in the loop and step thru to the row in question.

Use your Watch Window.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
It looks to me things are not sequentially but in parallel. Goes through the loop a few times /w messages and things in files looking out of sync. Then freezes..
 



Do you have some asynchronous process going?

You may need to test each one.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 




So certain things need to be at a certain status before other tings can happen, right?

Well your code has to test, usually in a loop, that THAT status, in order to proceed...
Code:
Do
  DoEvents
Loop Until ([b][i]some test condition[/i][/b])


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top