I want to update all the links in a certain Excel file and I put the code on a VBScript. What is wrong with the following code?
file = Directory2 & Filename2
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(file)
objExcel.Application.Visible = True
objExcel.ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources
objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close
This returns:
Error code: 800A0400