Excel Removing external links

Hello.
I am automating the customer’s Excel file.
Some customers are sending Excel files by setting up an external connection.

I cannot proceed with Excel Application Scope step.

I want to remove external links to Excel file by preprocessing.

I know it can be implemented as a VBA.
Is there any way to handle it with VBS or Activity?

Because of many customers, VBA is difficult to use and wants to use VBS or other methods.

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

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.