excel关闭连接服务器_Excel中的问题断开链接

excel关闭连接服务器

In the screen shot below, there are two files. Cell B4 in the worksheet at the right is linked to cell B7 in the sheet at the left. If you have a problem breaking links in Excel, this article might help fix that.

在下面的屏幕快照中,有两个文件。 右侧工作表中的单元格B4链接到左侧工作表中的单元格B7。 如果您在断开Excel中的链接时遇到问题,则本文可能会帮助您解决该问题。

链接单元格的文件 (Files with Linked Cell)

Here is the workbook with a cell that is linked to a different workbook.

这是带有链接到其他工作簿的单元格的工作簿。

breaklinksprotected01

In the file with the link, I can go to the Ribbon’s Data tab, and click the Edit Links command,

在带有链接的文件中,我可以转到功能区的“数据”选项卡,然后单击“编辑链接”命令,

breaklinksprotected03

编辑链接对话框 (Edit Links Dialog Box)

That opens the Edit Links dialog box, and shows a list of the links in the workbook.

这将打开“编辑链接”对话框,并显示工作簿中的链接列表。

To break the link to the other file, click the Break Links button.

要将链接断开到另一个文件,请单击“断开链接”按钮。

When the confirmation message appears, read the dire warnings, and make a backup, if you haven’t already done that.

出现确认消息时,请阅读可怕的警告并进行备份(如果尚未执行的话)。

Then come back to the Edit Links command, and click OK.

然后返回到“编辑链接”命令,然后单击“确定”。

breaklinksprotected02

断开链接按钮变暗 (Break Link Button Dimmed Out)

I use this technique in Excel programming sometimes, when creating copies of workbooks. By breaking the links, the formula results change to values, and the file can be sent to someone who doesn’t have the original source file.

创建工作簿的副本时,有时会在Excel编程中使用此技术。 通过断开链接,公式结果将更改为值,并且可以将文件发送给没有原始源文件的人。

Recently, I ran into a problem – the Break Link command wasn’t working in the macro, even though it had worked nicely for several months.

最近,我遇到了一个问题-Break Link命令在宏中不起作用,即使它已经运行了好几个月了。

So, to troubleshoot the problem, I tried to break the link manually. When the Edit Links window opened, the Break Link button was dimmed out.

因此,要解决此问题,我尝试手动断开链接。 当“编辑链接”窗口打开时,“断开链接”按钮变暗。

The link was still showing in the list, but I couldn’t change it or break it.

该链接仍显示在列表中,但我无法更改或破坏它。

breaklinksprotected04

发现问题 (Found the Problem)

After several head scratching moments (or hours, I can’t remember), I finally noticed that someone (probably me) had protected the sheet that was currently active.

经过数次头部抓挠片刻(或几个小时,我不记得了)之后,我终于注意到有人(可能是我)保护了当前处于活动状态的工作表。

The sheet with the link wasn’t protected, but that didn’t matter. If the active sheet is protected, you can’t break a link in the file.

带有链接的工作表没有受到保护,但这没关系。 如果活动工作表受到保护,则无法断开文件中的链接。

取消保护工作表 (Unprotect the Sheet)

So, if you’re having a problem breaking a link, check the active sheet for protection. You can do this manually, or in your VBA code.

因此,如果您在断开链接时遇到问题,请检查活动表以获得保护。 您可以手动执行此操作,也可以在VBA代码中执行此操作。

For example, if you’re doing this in a macro, activate a specific sheet, unprotect it, then break the link, and protect the sheet again. The code below breaks the first link in the file.

例如,如果您在宏中执行此操作,请激活特定的工作表,对其进行保护,然后断开链接,然后再次保护工作表。 下面的代码中断了文件中的第一个链接。

Dim astrLinks As Variant
astrLinks = wbNew.LinkSources(Type:=xlLinkTypeExcelLinks)
' Break the first link in the active workbook.
On Error Resume Next
With wbNew.Sheets(1)
   .Select
   .Unprotect
   .BreakLink Name:=astrLinks(1), _
    Type:=xlLinkTypeExcelLinks
On Error GoTo 0
   .Protect
End With

翻译自: https://contexturesblog.com/archives/2014/02/20/problem-breaking-links-in-excel/

excel关闭连接服务器

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值