Excel VBA - 数据导入后 [英] Excel VBA - After Data Import

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

问题描述

在数据连接(文本文件)刷新后,我需要创建一个应用某些代码的事件。如何控制数据刷新的时间。

I need to create an event to apply certain code after data connections (text files) have refreshed. How do i control when the data is refreshed.

推荐答案

在执行其他操作之前,关闭连接的后台刷新。然后使用ActiveWorkbook.RefreshAll所有的任何代码放置后不会执行,直到刷新后,只要背景刷新关闭所有连接。

Turn off background refresh on your connections before you do anything else. Then use ActiveWorkbook.RefreshAll any code placed after will not execute till after the refresh, as long as background refresh is off for all connections.

ActiveWorkbook.RefreshAll
other vba code here

这篇关于Excel VBA - 数据导入后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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