屏幕闪烁VBA Excel [英] Screen Flickering VBA Excel

查看:173
本文介绍了屏幕闪烁VBA Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我本人已经阅读的很多东西,但是找不到解决方案.我有一个大约10,000行的程序,其中有一个附加到特定命令按钮的程序.这样可以计算出一些复杂的方程式.

This is something I have read a lot myself but couldn't find the solution. I have a program of about 10,000 lines where I have a procedure attach to a particular command button. This calculates some complex equations.

我已经像往常一样使用Application.ScreenUpdating = False启动了代码,并在主过程结束之前将其变为True.但是,仅Excel表格的上部(在菜单栏附近)一直闪烁约10秒钟,直到出现结果为止.我尝试禁用事件,以及将计算转换为手动,但没有任何帮助.甚至尝试在与主过程相关的子过程的开头提到将屏幕更新显示为false.

I have started the code as usual with Application.ScreenUpdating = False and turned it to True just before ending of the main procedure. Yet just the upper part of my Excel Sheet (near the Menu Bar) keeps flickering about 10 second until the result appears. I tried disabling events, as well as turning the calculations to manual, but nothing helps. Even tried mentioning screen updating to false at the beginning of sub procedures related to main procedure.

任何对此的建议将不胜感激.谢谢!

Any suggestion regarding this will be really appreciated. Thank you!

推荐答案

尝试将其添加到子目录的开头:

Try adding this at the start of the sub:

Application.EnableEvents = False
Application.DisplayStatusBar = False
Application.Calculation = xlCalculationManual

这即将结束:

Application.EnableEvents = True
Application.DisplayStatusBar = True
Application.Calculation = xlCalculationAutomatic

那应该有所帮助.但是请注意,运行复杂的宏时,我的屏幕有时也会闪烁(Excel似乎没有响应,但在后台运行).

That should help. Note though, my screen also flickers sometimes when running complex macros (Excel looks like it's not responding, but it's working in the background).

这篇关于屏幕闪烁VBA Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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