Excel在宏过程中无响应 [英] Excel Not Responding During Macro

查看:75
本文介绍了Excel在宏过程中无响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在24/7连续循环上运行的宏.计算机有时会冻结,但是excel代码中没有错误.该代码使用以下命令以便有效运行:

I have a macro that runs on a continous loop 24/7. The computer will occasionally freeze but there is no error in the excel code. The code uses the following in order to run efficiently:

DoEvents
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
startagain:
'code
'calculations, alerts, and screen are updated
GoTo startagain

我还使用了我认为是一种有效的复制和粘贴方法(大部分代码都是粘贴值和公式):

I also am using what I believe is an efficient method of copying and pasting (a bulk of the code is pasting values and formulas):

Length = Range("C1").Value
Set rng = Sheets("Linked Data").Range("A2:AA" & Length)
Range("A2").Value = rng.Value

对于EXCEL.exe,我已将计算机上的处理器优先级更改为高",我将计算机性能设置为最高性能,禁用了所有不必要的加载项,并关闭了自动恢复保存功能.

I have chagned the processor priority on the computer to "high" for EXCEL.exe, I have the computer performance set to maximum performance, I have disable all un-necessary add-ins, and I have turned off autorecover saving.

尽管有上述所有情况,计算机有时仍会冻结并变得无响应.有谁知道可以做些什么来提高可靠性?

Despite all of the above, the computer will sometimes freeze and become unresponsive. Does anyone know anything that can be done to improve the reliability?

推荐答案

避免使用Goto并使用 Application.OnTime方法重复运行过程.

Avoid Goto and use Application.OnTime Method to run a procedure repeatively.

您还可以考虑创建一个Automation-addin,这可能会导致性能提高,因为其编译代码.

You can also think of creating a Automation-addin which may lead to performance imporvement as its compiled code.

请参考此链接

您也可以参考此链接以提高性能

You may also refer this link for performance imporvement link

这篇关于Excel在宏过程中无响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆