VBA 忽略 Excel 无法使用可用资源完成此任务
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19733756/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
VBA Ignore Excel cannot complete this task with available resources
提问by Fabio Rebelo
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:
我正在编写一个 VBA 代码,它将在我离开办公室后运行所有内容。宏工作正常,问题是有时(比我想要的更频繁)我收到消息:
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?
Excel 无法使用可用资源完成此任务。选择较少的数据或关闭其他应用程序。Excel 无法使用可用资源完成此任务。选择较少的数据或关闭其他应用程序。继续而不撤消?
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?
我只需单击“确定”,代码运行良好,但我确实手动单击“确定”,我已经尝试过,
Application.DisplayAlerts = False
但这不起作用。有谁知道我是否不能让excel“超越”这个问题?
Thank you in advanced
提前谢谢
回答by Instant Breakfast
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.
我相信“继续而不撤消”意味着 Excel 正在暂时清除它用来跟踪撤消级别的 RAM,然后(似乎)您的宏拥有完成该过程所需的资源。
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.
解决此问题的第二个选项可能是向您的机器添加 RAM,但它不会修复错误的原因。
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).
第三,如果您想冒险编辑注册表并减少或消除 Excel 中的撤消级别,您可以通过减少撤消级别的数量来防止此错误 ( http://support.microsoft.com/kb/211922)。