Processes in Microsoft 365 for setting up Office apps, redeeming product keys, and activating licenses.
Hello giuseppinasimone, Welcome to the Microsoft Community.I understand that you took a piece of VBA code through other articles in the community and used it inside your own documentation, but it seems clear that this doesn't quite apply to your situation. In the Microsoft community, we mainly provide advice and help for general Office application scenarios, but for VBA issues, we recommend you to discuss in the dedicated community, where users are more specialized in VBA related issues and I believe they can provide you with the help you need: Newest 'vba' Questions - Stack Overflow
Disclaimer: Microsoft provides no assurances and/or warranties, implied or otherwise, and is not responsible for the information you receive from the third-party linked sites or any support related to technology. Best RegardsEliac | Microsoft Community Support Specialist