Consider this Basic macro: sub addHyperlinkA1 doc = StarDesktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, Array()) oCell = doc.Sheets(0).getCellByPosition(0,0) oField = doc.createInstance("com.sun.star.text.TextField.URL") oField.URL = "http://www.example.org/" oField.Representation = "hyperlink" 'oCell.insertTextContent(oCell.createTextCursor(), oField, False) oCell.insertTextContent(oCell, oField, False) end sub This macro fails on the last line with 'insertTextContent' with: > BASIC runtime error. > An exception occurred > Type: com.sun.star.beans.UnknownPropertyException > Message: Selection. But uncommenting the line with createTextCursor (and commenting the line with bare 'oCell') succeeds. oCell implements XTextRange interface itself, so it must succeed.
https://gerrit.libreoffice.org/c/core/+/190085
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a8ce5af575ea5e05eb7c349d50b4eb08cab983ff tdf#168073: check if xRange is this It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-25-8": https://git.libreoffice.org/core/commit/1e040b72222012f9a5f1e47d19aaf0c0369e08ad tdf#168073: check if xRange is this It will be available in 25.8.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/02c9a71ea5344178b2849d153d0b1d83a681e334 tdf#168073: generalize the fix to other XText methods It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-25-8": https://git.libreoffice.org/core/commit/d4fb438cf3f3375ff72209b994f040a92b5c68db tdf#168073: generalize the fix to other XText methods It will be available in 25.8.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e7895c4a8e630de1ce88b721eef90ba8eb7da179 Related: tdf#168073 Extract ScEditFieldObj insertion into a function It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.