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

Catching a "Not Enough Memory" error

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
Is there any way to catch a "Not Enough Memory" error in VBA? I'm basically doing a load of processing in Excel which depends on the size of something else. When the size of this something else is huge, I get a "Not Enough Memory" error. Is there a way to redirect the processing when this occurs. Clive [infinity]
 
Have you tries the On Error Statement ?
(see VBE Help)

Regards
BrianB
** Let us know if you get something that works !
================================
 
Clive,

Run-time Error number 7 is "Out of Memory". Per BrianB's suggestion of using error trapping, you can check explicitly for this error (I'm just not sure the error you're getting is the same as Error 7). You could set up your error handling to display the error number and description, at least for testing purposes. With this in place, try to recreate the "huge processing" situation and see what happens.

Regards,
Mike
 
Thanks for your comments guys - sorry for the delay in replying...I was moved to a different project for a while. I added some On Error comments as Brian suggested and got it to spit out the error number and description as Mike suggested but it seems like it's not a VBA code error cos I don't seem to be able to catch it! Clive [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top