我有一个带有 excel 导出和导入的 vb.net 应用程序。我对这个应用程序不太熟悉,因为我的ec同事在没有太多信息的情况下把它留给了我。现在,当我尝试构建应用程序时,它显示以下错误
Error 115 Type 'Excel.IExcelDataReader' is not defined. E:CManagerCManager\Win764CManagerMyApp.vb 2376 28 ContributionManager
我试图得到它的dll,但找不到任何东西。
任何人都可以帮忙吗...
所以.. first
将引用添加到项目中的 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)
ExcelDataReader
。顺便说一句。你有没有听说过谷歌的东西;)
删除了现有的dll并再次添加! 已解决