How to fix Microsoft Office Interop references

Ronald Chandler 20 Reputation points
2024-04-06T18:23:13.3733333+00:00

I am trying to establish references to Word and Excel, and getting compile errors for the following:

Imports word = Microsoft.Office.Interop.Word, an

imports Excel = Microsoft.Office.Interop.Excel

Please respond

Ronald Chandler

hobbitdome@gmail.com

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,621 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 65,556 Reputation points
    2024-04-06T18:30:22.6533333+00:00

    You need to add the nuget package:

    https://www.nuget.org/packages/Microsoft.Office.Interop.Word

    this let your code compile. To run you will desktop version of word installed.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.