Excel VBA - 运行时错误 1004(RefreshAll 失败)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12616331/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Excel VBA - Runtime error 1004 (RefreshAll fails)
提问by CustomX
I have created a macro to refresh my workbook (recalc values, refresh links, etc).
我创建了一个宏来刷新我的工作簿(重新计算值、刷新链接等)。
The code to refresh links works fine but when it hits the RefreshAll
I get the following error.
刷新链接的代码工作正常,但是当它遇到RefreshAll
以下错误时。
ActiveWorkbook.UpdateLink Name:="F:\klanten.xlsm", Type:=xlExcelLinks
ActiveWorkbook.RefreshAll
All help is appreciated!
感谢所有帮助!
采纳答案by brettdj
Rather than a RefreshAll
option you are looking for a Calculate
option
RefreshAll
您正在寻找一个Calculate
选项,而不是一个选项
I suggest you use Application.CalculateFull
to calculate all formulae
我建议你Application.CalculateFull
用来计算所有的公式
This link from Charles Williams on Excel Calculation Methodsmay prove useful
查尔斯·威廉姆斯 (Charles Williams) 关于Excel 计算方法的链接可能证明有用