Old macro crashes libreoffice 7.03

Hi, I use this particular macro from here:

https://forum.openoffice.org/en/forum/viewtopic.php?f=21&t=2399

a lot – it selectively deletes custom styles.
It works fine in libreoffice 6.4.7 but when I try to run it in 7.03, the initial dialogue box comes up, I click yes and then the remove custom styles box doesn’t properly appear and after a brief hang, writer just force closes.
Can anybody fix the code? Presumbably something has changed in Basic in the last upgrade.
All help would be much appreciated. There’s no pressing need for me to upgrage libreoffice to v. 7 just yet, but at some point I’ll probably need to but I need this macro to work.

I test in ArchLinux LO 7.03 and work fine… always say your operate system.

I’m running Windows 10.