Dear Nicholas Ryan Wong Jun Jie,
Good day!
Thank you for posting to Microsoft Community. We are glad to assist.
We carefully checked your post and learned that your query is about User-defined type not defined. After consulting with the relevant team, since concern is related with VBA and for that we have separate dedicated team who have special expertise in VBA related all queries and have required tools and resource to check VBA related issue. Please forgive me, our forum is focused on Microsoft 365 for business, the knowledge of the VBA is relatively shallow, it is recommended to kindly post your query on Questions - Microsoft Q&A site, this is our dedicated support for VBA related issues, with more experience and professional insights. Our related expert support team will further work with you and further assist you.
Your understanding and cooperation are greatly appreciated.
wish you all the best.
Sincerely,
Winter| Microsoft Community Moderator