In order to troubleshoot this error, you must enable support for Visual Basic automation for the MS Office installation by following these steps:
- Go to Control Panel -> Add or remove programs (or Programs and features, depending on your Windows version).
- Find the version of MS Office you are using.
- Select it and click Change at the top of the programs list.
- Among the available options, find Office Tools and check the Visual Basic for Applications (VBA) option.
- Apply the change.