此操作将取消挂起的刷新数据命令 [英] This action will cancel a pending refresh data command

查看:480
本文介绍了此操作将取消挂起的刷新数据命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试这段代码时,出现错误此操作将取消挂起的刷新数据命令.继续吗?"

While I am trying this code I am getting the error "This action will cancel a pending refresh data command.continue?"

ActiveWorkbook.RefreshAll

即使我放了Application.Wait now() + TimeValue("00:01:20"),Excel也无法正确刷新.

Even if I put Application.Wait now() + TimeValue("00:01:20") Excel is not refreshing properly.

推荐答案

解决方案: 转到数据选项卡,单击连接组中的连接,单击每个连接,然后单击属性,取消选中显示启用后台刷新"的框." (tylerlohman@gmail.com,pcreview,2013年.).

Solution: "Go to the data tab, click connections in the connections group, click on EVERY connection and click properties, un-check the box that says "enable background refresh"." (tylerlohman@gmail.com , pcreview, 2013).

此错误可能是由于Excel超载导致的,但只能以这种方式报告.在尝试了有关"DoEvents","WAIT"/SLEEP,"FOR/NEXT"的所有建议并循环打开每个页面以单独刷新后,我从PCReview网站发现解决方案是在数据连接"属性中,而不是VBA.

This error may be caused by Excel being overloaded but only capable of reporting in this way. After trying all of the suggestions about 'DoEvents', 'WAIT'/SLEEP', 'FOR/NEXT' looping and opening each page to refresh singularly, I found, from PCReview website, that the solution is in the Data Connection properties and not VBA.

一旦所有后台刷新连接都被禁用,简单的"Activeworkbook.RefreshAll"命令就足以更新整个工作簿;我的页面大29页,有5个数据连接和7个SQL数据连接.

Once all background refresh connections have been disabled, the simple 'Activeworkbook.RefreshAll' command will suffice to update the entire workbook; mine was 29 pages large with 5 data connections and 7 SQL data connections.

注意:只有SQL数据连接允许刷新被禁用.

NB: It was only the SQL data connections which allow the refresh to be disabled.

希望这可以像我一样帮助任何对此问题感到头疼的人.

Hope that this helps with anyone having a headache over this issue as I did.

这篇关于此操作将取消挂起的刷新数据命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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