Hi,
I have 2 workbooks linked on the server: workbook 2 has a vlookup formula with the table array in workbook 1. When I open workbook 2, I have a value error cell, even if workbook 1 is opened. If I manually close workbook 1 and reopen it, I have the right value. If I do it with a macro, I have error value.
I have ticked and unticked the "let user choose" and my preference definitely goes to don't display alerts and update links.
What I don't understand is why does it work if I do it manually but not through VBA.
In addition, normally if you close workbook 1 and check status is edit links, it goes from unknown to waarning! Values referring to other workbooks were not updated. Here it shows OK.
Those are a bit of everything I tried. It opens workbook 2 but nothing happens. Dag_Prod is the name of workbook 1.
Any bit of help is welcome.
I have 2 workbooks linked on the server: workbook 2 has a vlookup formula with the table array in workbook 1. When I open workbook 2, I have a value error cell, even if workbook 1 is opened. If I manually close workbook 1 and reopen it, I have the right value. If I do it with a macro, I have error value.
I have ticked and unticked the "let user choose" and my preference definitely goes to don't display alerts and update links.
What I don't understand is why does it work if I do it manually but not through VBA.
In addition, normally if you close workbook 1 and check status is edit links, it goes from unknown to waarning! Values referring to other workbooks were not updated. Here it shows OK.
Those are a bit of everything I tried. It opens workbook 2 but nothing happens. Dag_Prod is the name of workbook 1.
Code:
Dim arrlinks, i As Integer
Application.DisplayAlerts = False
'On Error Resume Next
arrlinks = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(arrlinks) Then
For i = 1 To UBound(arrlinks)
Workbooks.Open arrlinks(i), UpdateLinks:=3
'Debug.Print arrlinks(i)
Next i
End If
Dag_Prod.Activate
'ThisWorkbook.UpdateLink Name:=ThisWorkbook.LinkSources
Calculate
Dag_Prod.RefreshAll
Dag_Prod.Save
On Error GoTo 0
Application.DisplayAlerts = True
Any bit of help is welcome.