English 中文(简体)
Can t Open Excel file using Excel Services in VB.net
原标题:Can t Open Excel file using Excel Services in VB.net

我在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

谁能告诉我我我我我什么是错的?

最佳回答

在与Microsoft支持联系之后,他们指出我的“错误”:

您不能在浏览器上开一个轴心(见下文URL):

Differences between using a workbook in Excel and Excel Services http://office.microsoft.com/en-us/excel-help/differences-between-using-a-workbook-in-excel-and-excel-services-HA010021716.aspx

所有其他Microsoft Office Excel文档格式都没有得到支持,包括Excel 2007 Macro-Enabled Workbook(xlsm)和Excel 2007 97-2003工作手册(xls)。

Save as .xlsx andtries re.

利用建议的格式解决了我的问题。

问题回答

暂无回答




相关问题
SharePoint 2010 Blog site template and post security

I asked this question on msdn forums but got no response in 24 hours. I am pasting the question here, I am sure you guys out there can help me :) This is my first post: I created a blog site with SP ...

Sharepoint 2010 - Custom Ribbon

i m developing a sharepoint project and central admin pages (located in _layouts), and i want to use Ribbon bar. i have found this sample but i hope so, it is wrong.. http://sharepointsolutions.com/...

Printing an InfoPath 2010 form in SharePoint 2010

Does anyone know where the option to print an infopath form (in my case a customized list form) exists in SharePoint 2010? In MOSS this functionality comes out of the box but either I am missing ...

Sharepoint 2010 Email Event Receiver not firing?

I have two event recievers setup on a list in 2010. The first is a ItemAdded reciever that works every time: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft....

Access Services and SharePoint 2010 - Need Info

I ve been asked to research the ability to publish Access solutions directly to SharePoint as demonstrated in the demo below. http://channel9.msdn.com/shows/Access/Microsoft-Access-2010-Demo/ I m ...

热门标签