Problems writing a value with Mid() in a macro

I have a macro which I have used in an old version of OpenOffice for a long time and it’s worked flawlessly on some pretty big spreadsheets. I cannot get this to work in Libreoffice 7.4.2.3 ( or some earlier versions too) The crux of the problem is that this statement won’t write the 1 (or a variable) to wtprod$

Mid(wtprod$, 1, 1) = “1”

I have also tried the statement form

Mid(wtprod$, 1, 1, “1”)

Using Mid() for referencing works ok. Am I missing something here?
Any help would be much appreciated.

The following macro shows “LO”.

Option Explicit
Sub Test
  Dim s As String
  s="OO"
  Mid(s, 1, 1)="L"
  Msgbox s
End Sub
Version: 7.4.2.3 (x64) / LibreOffice Community
Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf
CPU threads: 6; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: threaded

Thanks - Explicitly initialising it works.