简体   繁体   English

如何通过VBA刷新数据库公式

[英]How to refresh database formula through VBA

I have an xls sheet which has formulae to fetch data through a database. 我有一个xls工作表,其中包含用于通过数据库获取数据的公式。 To get the data, I go to the top ribbons in xls, click on the database ribbon and then click refresh. 要获取数据,我转到xls顶部的功能区,单击数据库功能区,然后单击“刷新”。 The xls shortcut to get the data is ALT Y1RS 获取数据的xls快捷方式是ALT Y1RS

Can somebody please help me tell how can I write a VBA code so that ALT Y1RS is pressed in xls. 有人可以帮我告诉我如何编写VBA代码,以便在xls中按ALT Y1RS。

尝试使用以下代码

ActiveWorkbook.RefreshAll

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM