Sub LinkToExternalData ' +---------+ ' [1] Create new "CSV.csv" containing |0,1,2,3,4|. ' +---------+ ' [2] Create new "ODS.ods". ' Link "ODS.ods" to "CSV.csv" using "[Sheet] [Link to external Data]". ' "Update eyery: ?? seconds" should not be checked, it's not neccessary for this testing. ' [3] Start macro. ' [4] Results ' +---------+ ' ODS.ods: |0,1,2,3,4| ist to be seen. ' +---------+ ' MsgBox : Xmax=4 ' Ymax=0 ' Cell(4,0)=4 ' Cell(5,1)=0 ' +-----------+ ' [5] Modify "CSV.csv" to |0,1,2,3,4,5| ' |0,1,2,3,4,5| ' +-----------+ ' [6] Start macro again. ' [7] Results ' +-----------+ ' ODS.ods: |0,1,2,3,4,5| ist to be seen. ' |0,1,2,3,4,5| ' +-----------+ ' New values ! ' MsgBox : Xmax=4 ' Ymax=0 ' Cell(4,0)=4 ' Cell(5,1)=0 ' Still old values ! ' [8] It seems to be, that the macro has no access to the updated data of the "ODS.ods". Dim HOME As String : HOME = "E:/APP/LinkToExternalData/" ' MODIFY ! Dim ODS As String : ODS = "ODS.ods" Dim oODS As Object Dim oCell_x4y0 As Object Dim oCell_x5y1 As Object Dim oCursor As Object Dim oSheet As Object Dim Xmax As Long Dim Ymax As Long Dim aP(0) As New com.sun.star.beans.PropertyValue aP(0).Name = "Hidden" aP(0).Value = False oODS = StarDesktop.loadComponentFromURL(ConvertToUrl(HOME & ODS),"_blank",0,aP()) oSheet = oODS.Sheets(0) oCursor = oSheet.createCursor oCursor.GotoEndOfUsedArea(False) Xmax = oCursor.getRangeAddress().endColumn Ymax = oCursor.getRangeAddress().endRow oCell_x4y0 = oSheet.getCellByPosition(4,0) oCell_x5y1 = oSheet.getCellByPosition(5,1) MsgBox("Xmax=" & Xmax & Chr(10) &_ "Ymax=" & Ymax & Chr(10) &_ "Cell(4,0)=" & oCell_x4y0.Value & Chr(10) &_ "Cell(5,1)=" & oCell_x5y1.Value) oODS.Close(True) End Sub