如何使用VBA刷新单元格? [英] How to refresh cells using VBA?

查看:651
本文介绍了如何使用VBA刷新单元格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用出现在以下位置的所有解决方案:

I am using all the solutions that appear in:

如何通过VBA刷新所有单元格

将Excel导入在VBA中刷新工作表上的数据

ActiveSheet.EnableCalculation = False  
ActiveSheet.EnableCalculation = True

Application.Calculate

Application.CalculateFull

它们都不在Excel 2010中起作用.当我转到单元格并右键单击刷新时,它起作用.如何在VBA中刷新?

None of them works in Excel 2010. When I go to the cell and right click refresh it works. How can I refresh within VBA?

Sheets("Name_of_sheet").Range("D424").Refresh引发一个

例外438

exception 438

问题:

  1. 如何使脚本支持Excel 2003、2007、2010?
  2. 如何选择要使用VBA刷新的源文件?

  1. 我想模拟鼠标右键,然后在worksheet 3的菜单中选择刷新".这就是整个故事.

  1. I want to simulate a right mouse click and choose refresh in the menu in worksheet 3. That is the entire story.

我处理的是10年前创建的Excel文件.在Excel 2010中打开时,我可以转到一个单元格并右键单击它,然后选择刷新",然后选择要从中刷新的.txt文件.我正在尝试在VBA中自动执行此操作.

I work on an Excel file created 10 years ago. When opening in Excel 2010, I can go to a cell and right click on it and choose refresh and then choose the .txt file to refresh from. I am trying to do it automatically within VBA.

推荐答案

您可以尝试使用 查看全文

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