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

******@gmail.com

Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 78,236 Reputation points Volunteer Moderator
    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.