我在2010年Sharami第一次尝试解决Excel服务问题。 我试图打开一份Excel文件,我把文件上载到我共同的文件。 我已经核实,我可以通过浏览器,使用以下ur子手工打开档案:
http://myserver/joint%20Documents/Adds2011.xls
然而,在把这传到以下网站时,我会遇到一个错误。 通常:
Private Sub OpenExcel(myurl As String)
Dim xlApp As New exServices.ExcelService
xlApp.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim status(10) As exServices.Status
Dim sessionID As String = ""
Try
sessionID = xlApp.OpenWorkbook(myurl, "en-US", "en-US", status)
Dim sheetInfo() As exServices.SheetInfo = xlApp.GetSheetNames(sessionID, status)
Dim cell As Object = xlApp.GetCell(sessionID, sheetInfo(0).Name, 1, 1, True, status)
Catch ex As Exception
Debug.WriteLine(ex.ToString)
End Try
If sessionID <> "" Then
xlApp.CloseWorkbook(sessionID)
End If
End Sub
我收到以下错误:
A first chance exception of type System.Web.Services.Protocols.SoapException occurred in System.Web.Services.dll System.Web.Services.Protocols.SoapException: The workbook that you selected cannot be opened.
The workbook may be in an unsupported file format, or it may be corrupt. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at SMSMInventory.exServices.ExcelService.OpenWorkbook(String workbookPath, String uiCultureName, String dataCultureName, Status[]& status) at SMSMInventory.LoadSpreadsheetUserControl.OpenExcel(SPFile mySpFile) Auto-attach to process [4292] w3wp.exe on machine FS-CHI-SPDEV succeeded. A first chance exception of type System.Web.Services.Protocols.SoapException occurred in System.Web.Services.dll
谁能告诉我我我我我什么是错的?