Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I've uninstalled and reinstalled my Office 365. The error still occurs.
The code I'm running is:
Dim objWord As Object
Dim MyCounty As String
Dim MyDeed As String
Dim mySelection As Object
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Documents.Add Template:="D:\Documents\Custom Office Templates\file_template.dotm"
I've looked at this link https://learn.microsoft.com/en-us/office/vba/Language/Reference/User-Interface-Help/activex-component-can-t-create-object-or-return-reference-to-this-object-error-4 but it's not really helping. The uninstall/reinstall should have taken care of the registry problems, the DLL objects, and anything else mentioned in the article.
What am I missing?
–
Check that you have the Microsoft Excel Object Library and the Microsoft Office Object Library ticked in Tools > References and that they have been registered.
If they are ticked, you may need to run Detect and Repair from the Excel Help menu to make sure that the Office installation hasn't corrupted in any way.
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.