.net读取excel文件时出现oledb错误

下面是我用于读取excel文件的代码。
我testing我的电脑本地主机和3窗口服务器。
本地主机和服务器的1工作正常,其他2服务器将返回错误
object reference not set to an instance of an object.

3服务器文件夹权限相同,并且excel文件以正确的path存在。
我不知道为什么在某些服务器发生错误。

VB.net代码

 Dim objExcelConn As New OleDb.OleDbConnection objExcelConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & str_FilePath & ";Extended Properties=""Excel 8.0;HDR=No;IMEX=1""" Try objExcelConn.Open() <------ Where the error occur Catch ex As Exception Throw (New Exception(ex.InnerException.Message)) End Try 

我不认为你会在你的服务器上安装excel。
问题是你没有excel的驱动程序在服务器上。
尝试下载.dll并再次运行您的应用程序。