0

我有一个带有 excel 导出和导入的 vb.net 应用程序。我对这个应用程序不太熟悉,因为我的 ec 同事在没有太多信息的情况下把它留给了我。现在,当我尝试构建应用程序时,它显示以下错误

Error   115 Type 'Excel.IExcelDataReader' is not defined.   E:\CManager\CManager\\Win764\CManager\MyApp.vb  2376    28  ContributionManager

我试图获取它的 dll 但找不到任何。

有人可以帮忙解决这个问题吗...

4

3 回答 3

1

所以..首先
将Referente添加到您的项目到Microsoft.Office.Interop,在COM部分

在您的表格中

 Imports Microsoft.Office.Interop.Excel
 Imports Microsoft.Office.Interop

并使用

    Dim xlApp As Microsoft.Office.Interop.Excel.Application
    Dim xlWorkBook As Microsoft.Office.Interop.Excel.Workbook
    Dim xlWorkSheet As Microsoft.Office.Interop.Excel.Worksheet

 xlApp = New Microsoft.Office.Interop.Excel.Application
 xlWorkSheet = xlWorkBook.Sheets("sheet1")

'在工作表上写一些
'并保存它!

   xlWorkSheet.SaveAs("D:\Reports\" & worker & Id & ".xlsx")

    xlWorkBook.Close()
    xlApp.Quit()

    releaseObject(xlApp)
    releaseObject(xlWorkBook)
    releaseObject(xlWorkSheet)
于 2015-02-04T11:25:34.853 回答
0

删除了现有的 dll 并再次添加!它解决了

于 2015-02-04T10:54:18.060 回答
0

ExcelDataReader

...顺便提一句。你有没有听说过谷歌的东西;)

于 2015-02-04T08:28:33.130 回答