【问题标题】:Importing the Microsoft.Office.Interop.Excel namespace导入 Microsoft.Office.Interop.Excel 命名空间
【发布时间】:2013-06-06 21:22:42
【问题描述】:

我需要在我的 ASP.NET Web 应用程序中使用 excel 自动化。我正在尝试使用以下代码将其导入 .aspx 文件: <%@ Import Namespace="Microsoft.Office.Interop.Excel" %> 但是,当我在浏览器中打开页面时,我收到错误 The type or namespace name 'Office' does not exist in the namespace 'Microsoft'。所以我假设我必须在我的项目中添加一些库。我正在使用 IIS 7.5 创建此 Web 应用程序,而不是 Visual Studio。那么有没有办法将外部库导入到我在 IIS 中的 ASP.NET 项目中?

【问题讨论】:

    标签: asp.net iis excel-automation


    【解决方案1】:

    右键单击参考 - .Net 选项卡 - Microsoft.Office.Interop.Excel

    Excel 2010 使用版本 14 / Excel 2007 使用版本 12

    点击确定。

    【讨论】:

      【解决方案2】:

      您应该能够将 Microsoft.Office.Interop.Excel.dll 拖放到 bin 目录中。如果这不起作用,请尝试将其添加到您的 web.config 文件中的 <assemblies>

      Assemblies in Web.config

      【讨论】:

      • 谢谢!我在哪里可以找到 Microsoft.Office.Interop.Excel.dll 文件?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-09-05
      • 2017-01-25
      • 2012-06-01
      • 2018-01-05
      • 2010-09-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多