0

I'm writing a VBA code that will run everything after I leave the office. The macro works fine, the problems is that sometimes (more often than I'd like) I get the message:

Excel cannot complete this task with the available resources. Choose less data or close other applications. Excel cannot complete this task with the available resources. Choose less data or close other applications. Continue without Undo?

I just click OK and the code runs fine, but I have do click the OK manually, I've already tried the Application.DisplayAlerts = False but this doesn't work. Does anyone know if I can't make excel "overpass" this problem?

Thank you in advanced

Fabio Rebelo
  • 109
  • 2
  • 5
  • 13

1 Answers1

0

I believe "Continue without Undo" means Excel is temporarily clearing the RAM it uses to track undo levels and then (it seems) your macro has the resources it needs to complete the process.

Take a look at what your macro is doing to use so much RAM: Is there a way to modify it so that less RAM is required? There are several options for this listed here:

How to clear memory to prevent "out of memory error" in excel vba?

Second option to fix this might be adding RAM to your machine, but it will not fix the cause of the error.

Third, if you want to risk a registry edit and reduced or eliminated undo levels in Excel, you might be able to prevent this error by reducing the number of undo levels (http://support.microsoft.com/kb/211922).

Community
  • 1
  • 1
Instant Breakfast
  • 1,383
  • 2
  • 14
  • 28
  • Hello, So, my macro is not doing anything special, it just update a table from the SQL server, the problem is that I'm using a huge table (400k lines x 130 col) I don't this that there's a solution right? If I reset my pc and them try to run it i don't get this message! But after a whole day on the computer is slower and so i get this message – Fabio Rebelo Nov 04 '13 at 15:17
  • What are you doing with that table? It might help if you shared the type of functions you are performing and how you are doing it (maybe even include relevant code). – Instant Breakfast Nov 05 '13 at 17:40
  • I use the macro to check if a email has arrived, and then I do a simple `ThisWorkBook.Refreshall` – Fabio Rebelo Nov 05 '13 at 20:47