Home » excel » vba – Can't set reference in Excel IDE to MS Word

vba – Can't set reference in Excel IDE to MS Word

Posted by: admin April 23, 2020 Leave a comment

Questions:

I want to populate a Word document with values from an Excel spreadsheet. Apparently the way to do this is to make reference to MS Word and use the following code snippet:

Dim wrdApp As Word.Application

However I get an error:

“User-Defined Type Not Defined”

So I try and set the reference via the tools menu but the references option is greyed out.

What do I need to do to enable this feature?

How to&Answers:

The references option in the editor is greyed out when the application is in break mode or code is otherwise running. I closed excel, reopened it and was able to add the Microsoft Word library reference.