Hopefully you made a backup of your previous user profile. If not you have lost your macros most likely.
Got to the backup and find the ...\user.bak\basic\
folder where user.bak
is the supposed name of the backup folder.
Copy it completely and replace the newly created ...user\basic\
folder with it.
This is for Windows. For different OS regard LibreOffice user profile - The Document Foundation Wiki .
If you want to remove / change /add routines do it from the Basic IDE.
===Edit 2019-12-21 10:50 UTC===
As a result of the exchange via comments on the question I add the following:
The Basic libraries and modules need to be registered in a sense. This is done automatically by the Basic IDE writing to the files script.xlc
and dialog.xlc
in the basic folder and respectively script.xlb
and dialog.xlb
in the library folders.
When recreating the Basic part in a virgin user profile from the backup, these files need to also be correcctly copied to their places in the new profile (dialog.xl?
may be absent if no dialogs are defined in a library). If they are present there and not corrupted themselves, everything should work.
A single module mName
is saved to a mName.xba
file in the library’s folder. The content, however is in XML and therefore many characters of the Basic code are escaped in html style. To recreate a module for which the .xlb file was lost. or which not correctly is listed in the .xlc file via the Basic IDE is annoying therefore. It may be easier to very thoroughly create/edit manually the needed XML files instead.