Dim Statement help page [1] tells: > String: String variable consisting of a maximum of 64,000 ASCII characters. This is not true: the strings can have up to almost 2^31 Unicode characters (strictly speaking, the current implementation, based on rtl::OUString, can hold up to 2 147 483 642 UTF-16 code units exactly). [1] https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03102100.html?DbPAR=BASIC
Oh, and I learned now, that since commit a44c9d023041c881f7858ddd9d93809dc1861313, on 64-bit systems, strings may safely contain exactly 2^31 - 1 = 2 147 483 647 characters. Not a huge difference, just getting more pedant points into karma :)
Pierre F committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/help/commit/4e1458853a317d6efbc222e7719e06be10d98817 fix String limit text/sbasic/shared/03102100 tdf#157822