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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

breaking on code

Status
Not open for further replies.

christhedonstar

Programmer
Apr 9, 2007
215
GB
Hi,

I when I run some macros in a workbook sometimes it just breaks on code for no apparent reason and then I have to hit f5 to carry on.

I've tried:

1) Compiling and saving
2) Rebooting
3) Repairing the sheet

Any ideas?

Thanks,

Chris
 
Also, in the VBA IDE, check Tools|Options|General to verify that the error trapping settings are set correctly.

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
hi

You may have to move all your code and sheets to new excel file.I have seen an addin called CLEAN PROJECT which takes all the worksheet in a workbook to fresh xls file and then moves the code to the same fresh xls . I guess it should work in your case and it may be memory related problem.
Try to do it manually if you dont get that addin in net.
sometime it works if all the excel instances are closed and system restarted. try this also

Stefen



 
This is getting reported more and more and there is no known fix - or even an admitted problem as far as I know.

Closing all open Applications that use VBA (Office and non-Office) and then restarting might work. Failing that, a reboot may be needed. Whatever, the fix is only temporary and the problem may re-occur at any time.

I have found it to be an issue when using MsgBox and/or Debug.Print, but do not know what, if any, the relationship may be. Also, in Word, wrapping troublesome code in: [blue][tt]Application.EnableCancelKey = wdCancelDisabled[/tt][/blue] and [blue][tt]Application.EnableCancelKey = wdCancelInterrupt[/tt][/blue] stops it but has an obvious downside. You may find the [blue][tt]xlErrorHandler[/tt][/blue] option helpful (I haven't tried it).

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
I posted to the forum a while back with this exact same issue ( and, as Tony stated, there is no fix available. We continue to experience this off and on and the only thing that makes it go away is a reboot, but it inevitably returns. If Microsoft would admit that the problem exists, at least we'd be a little closer to an answer. God only knows if this one will ever get fixed!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top