--- Revision 656331373462 +++ Revision 353338353339 @@ -11,20 +11,21 @@ Next End Select End Sub -2 + Sub RangeReplaceHyperlink(ByVal address) sheet = ThisComponent.Sheets(address.Sheet) - For y = address.StartRow To address.EndRow - For x = address.StartColumn To address.EndColumn - ReplaceHyperlink(sheet.getCellByPosition(x, y)) + For x = address.StartColumn To address.EndColumn + For y = address.StartRow To address.EndRow + cell = sheet.getCellByPosition(x, y) + If (cell.String = "") Then + Exit For + End If + ReplaceHyperlink(cell) Next Next End Sub Sub ReplaceHyperlink(ByVal cell) - If (cell.String = "") Then - Exit Sub - End If hyperlink = ThisComponent.createInstance("com.sun.star.text.TextField.URL") hyperlink.Representation = cell.String hyperlink.URL = cell.String