C#:“找不到编译动态表达式所需的一种或多种类型”

问题描述 投票:0回答:1

我复制代码以从Excel文件中删除标题。我在以下代码中出现错误:

Microsoft.Office.Interop.Excel.Worksheet clsWorksheet =
                 (Excel.Worksheet)clsWorkbook.ActiveSheet;

错误是:

One or more types required to compile a dynamic expression cannot be found. Are you missing a reference?

Screenshot here

我该如何解决?

c# ssis
1个回答
1
投票

Are you missing a reference?您需要向项目中添加Excel库(.dll)。如果已安装Excel,则应该能够找到“ Microsoft Excel 11.0对象库”

© www.soinside.com 2019 - 2024. All rights reserved.