Friday, April 9, 2010

VBScript - How Can I Update and Then Break All the Links in an Excel Spreadsheet?

VBScript - How Can I Update and Then Break All the Links in an Excel Spreadsheet?

Const xlLinkTypeExcelLinks = 1
Const xlExcelLinks = 1

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True

Set objWorkbook = objExcel.Workbooks.Open("C:\Scripts\Test.xls", 3)

arrLinks = objWorkbook.LinkSources(xhttp://www.blogger.com/post-create.g?blogID=4199523701313049442lLinkTypeExcelLinks)

For i = 1 to Ubound(arrLinks)
objWorkbook.BreakLink arrLinks(i), xlLinkTypeExcelLinks
Next

[Via]