Excel Removing external links

I disconnected Excel external links using VBScript.
To help many people :slight_smile:

1. Souce
Set objExcel = Createobject(“Excel.Application”)
set objWorkbook = objExcel.Workbooks.Open(Wscript.Arguments.Item(0))

aLinks = objWorkbook.LinkSources

if not IsEmpty(aLinks) then
For Each LinkSource In aLinks
objWorkbook.BreakLink LinkSource,1
Next
end if

objWorkbook.Save
objWorkbook.Close
objExcel.Quit

Set objWorkbook = Nothing
Set objExcel = Nothing

2. Using
input : Wscript.Arguments.Item(0)
ouput : Wscript.Echo(“text”)
3. Excel Files(External Links) Check
If you make an error without disconnecting the external link,
You can correct this part to make it an error before running Excel.


if not IsEmpty(aLinks) then
Wscript.Echo (“Error”)
end if

If anyone creates Custom activity, please share it.

Best Regards.
@balupad14

1 Like