標題:
如何刪除所有連結
[打印本頁]
作者:
enoch
時間:
2012-9-24 10:53
標題:
如何刪除所有連結
在EXCEL 說明中找到刪除檔案中第一個連結
但如何可以一次刪除所有連結,
而當檔案中沒有連結時而不會出現錯誤訊息
Sub UseBreakLink()
Dim astrLinks As Variant
' Define variable as an Excel link type.
astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
' Break the first link in the active workbook.
ActiveWorkbook.BreakLink _
Name:=astrLinks(1), _
Type:=xlLinkTypeExcelLinks
End Sub
作者:
kimbal
時間:
2012-9-25 21:55
Sub UseBreakLink()
Dim astrLinks As Variant
' Define variable as an Excel link type.
astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
if not isempty(astrLinks) then
' Break the first link in the active workbook.
ActiveWorkbook.BreakLink _
Name:=astrLinks(1), _
Type:=xlLinkTypeExcelLinks
end if
End Sub
複製代碼
作者:
Hsieh
時間:
2012-9-25 23:31
回復
1#
enoch
Sub UseBreakLink()
Dim astrLinks As Variant
' Define variable as an Excel link type.
astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
Do Until IsEmpty(astrLinks)
' Break the first link in the active workbook.
ActiveWorkbook.BreakLink _
Name:=astrLinks(1), _
Type:=xlLinkTypeExcelLinks
astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
Loop
End Sub
複製代碼
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)