Hi Everyone,
The following simple code make my excel crash.
Any help is appreciated.
Please Login or Register to view this content.
Hi Everyone,
The following simple code make my excel crash.
Any help is appreciated.
Please Login or Register to view this content.
Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.
Incidentally you don't need all those .Select statements, they just slow things down, although it won't be those that cause the workbook to close.
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
Attached
When run individually this macro runs well.
But its part of big file and that file crashed every time when I run this macro.
Hi,
The idea was that you would upload the workbook that was crashing, not one that doesn't.
We can't test what might be failing otherwise.
That said your error handler which directs program flow back into the loop is bad programming practice, particularly if you've no idea what error might arise.
Just a guess but you could have entered a runaway loop from which never finishes and Excel just runs out of memory and gives up.
Hi Richard,
I am sorry, the original file cannot be uploaded as there is confidential information in there.
The macro was running fine until last week.
I haven't done any structural changes in the file or in fact no change in macro codes at all.
Anyhow thank you for your time and feedback.
I will try to figure out what's going on by breaking the code and run it line by line.
BR,
@Richard:Am I missing something? What error handling?That said your error handler which directs program flow back into the loop is bad programming practice, particularly if you've no idea what error might arise.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks