The above error is likely to be caused by settings in Excel. Please follow the steps below to update these settings:
Open Excel.
Go to File, click Options and then click Trust Centre.
Open Trust Centre Settings... and select Macro Settings.
Ensure the βTrust access to the VBA project object modelβ is ticked.
