受欢迎的博客标签

Microsoft.Office.Interop.Excel cannot be found

Published

https://blog.csdn.net/Embest028/article/details/83141976

.Net 5.x

1.DocumentFormat.OpenXml (Open XML SDK)

 you don’t really need Microsoft Office to be installed on the machine.

The Open XML SDK provides us full control to deal with Office Word, Excel, and PowerPoint documents. As this SDK is free and open-source from Microsoft, we don’t really need to use any other third-party tools/libraries. This SDK works best!

https://www.thecodebuzz.com/read-excel-file-in-dotnet-core-2-1/

2.the Microsoft.Office.Interop.Excel wouldn't be possible to port to .Net core because it relies on the Office interops. 

.NET Core 2.0

.NET Core 2.0.  That is, COM Interop works, but late binding using the C# dynamic keyword still doesn’t function.

dynamic excel = Activator.CreateInstance(Type.GetTypeFromProgID("Excel.Application", true));
excel.Visible = true;
Console.WriteLine("Press Enter to close Excel.");
Console.ReadLine();
excel.Quit();

 

.net Framework

Microsoft.Office.Interop.Excel 

This the assembly necessary to do Office 2013 Excel interop

 

C#项目添加excel引用Microsoft.Office.Interop.Excel.dll

如果需要使用C#处理excel,需要引用Microsoft.Office.Interop.Excel;如何找到这个dll文件啊。 

(1)windows 全盘搜索 Microsoft.Office.Interop.Excel; 

(2)将这个DLL文件加载至你的项目中 ,把dll文件放到应用程序…\bin\Debug\下
    3)然后在解决方案的项目添加引用:右键鼠标–>添加引用–>浏览–>选择dll放置路径后点击“确定”。 
最后在项目源代码头文件加入对应的引用。

(4)最后在项目源代码头文件加入对应的引用。

using Microsoft.Office.Interop.Excel;

图文见:https://blog.csdn.net/zgscwxd/article/details/86575439

 

using Microsoft.Office.Interop.Excel;

 

Usef links

How to fix Microsoft.Office.Interop.Excel.dll missing error?