vba 如何停止在 Excel 中更新彭博链接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23079945/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 02:46:20  来源:igfitidea点击:

How to stop Bloomberg links updating in Excel

excel-vbabloombergvbaexcel

提问by Reno

I am trying to use an Excel workbook that has links to Bloomberg data in. The data has been pulled from Bloomberg already. I then want to ensure that when I send this workbook to someone that they can use the sheet without a Bloomberg terminal connection. The user without the Bloomberg feed has set calculations to manual in Excel however when they try and save the workbook it automatically tries to update the fields and gives #NAME errors in the fields where Bloomberg values should be.

我正在尝试使用一个 Excel 工作簿,其中包含指向 Bloomberg 数据的链接。该数据已经从 Bloomberg 中提取出来了。然后我想确保当我将此工作簿发送给某人时,他们可以在没有彭博终端连接的情况下使用该工作表。没有彭博提要的用户已在 Excel 中将计算设置为手动,但是当他们尝试保存工作簿时,它会自动尝试更新字段并在彭博值应为的字段中给出 #NAME 错误。

Is there a way to stop Excel from trying to refresh the Bloomberg links when the workbook is saved? I have tried VBA Workbook_AfterSave and Workbook_BeforeSave events but that did not seem to work.

有没有办法阻止 Excel 在保存工作簿时尝试刷新彭博链接?我尝试过 VBA Workbook_AfterSave 和 Workbook_BeforeSave 事件,但这似乎不起作用。

Any suggestions gratefully received.

任何建议都非常感谢。

回答by Reno

A touch embarassed to admit but in Options > Formulas > Manual there is a check box for calculating the workbook before saving. I unchecked that and it worked.

有点不好意思承认,但在选项 > 公式 > 手动中有一个复选框,用于在保存之前计算工作簿。我取消选中它并且它起作用了。

回答by ytoledano

According to the license, you're not supposed to remove values obtained using the API (Excel) from the computer where the Bloomberg Terminal is installed. That being said, if cells cease being Excel formulas they will no longer attempt to update to an up-to-date value. To do this, copy the cells that currently have a BDP/BDH formula and right click -> paste special -> values. This is also useful if you don't want the values refreshing every time you open the worksheet on the same computer.

根据许可证,您不应该从安装了彭博终端的计算机中删除使用 API (Excel) 获得的值。话虽如此,如果单元格不再是 Excel 公式,它们将不再尝试更新为最新值。为此,复制当前具有 BDP/BDH 公式的单元格并右键单击 -> 粘贴特殊 -> 值。如果您不希望每次在同一台计算机上打开工作表时都刷新值,这也很有用。