Excel服务无法打开工作簿

我正尝试在SharePoint Server 2010上使用Excel服务打开一个工作簿(excel 2010)。 无论我尝试打开哪个工作簿(即使从头开始创build工作簿),Excel服务的“OpenWorkbookForEditing”方法都会失败,并且“您select的工作簿无法打开。工作簿可能不受支持的文件格式,或者可能腐败“。

我已经search了这一点,并在networking上的所有答案似乎不适合。 我已经重置IIS,我已经删除了所有安全的设置在信任中心的Excel中,我已经尝试.xls,.xlsx,.xlsm文件,我已经确保Excel文件在SharePoint中的受信任位置。

我完全被这个困惑了。

SPListItem newListItem = SPContext.Current.Web.GetListItem(SPContext.Current.Web.Lists[Constants.SharePointListName.TemporaryFileLibrary].RootFolder.ServerRelativeUrl + "/" + SPContext.Current.Web.Properties[SPContext.Current.Web.CurrentUser.LoginName].ToString()); Microsoft.Office.Excel.Server.WebServices.ExcelService cli = new Microsoft.Office.Excel.Server.WebServices.ExcelService(); Microsoft.Office.Excel.Server.WebServices.Status[] status; // Open the workbook. - THIS IS THE POINT OF FAILURE. string sessionId = cli.OpenWorkbookForEditing(SPContext.Current.Web.Url + "/" + newListItem.File.Url, "", "", out status); 

尝试logging下列值:

  SPContext.Current.Web.Url + "/" + newListItem.File.Url 

这可能是,这不是一个Excel文件。

确保为Web应用程序configuration了Excel服务“服务应用程序关联”。

您可以启用该function

应用程序pipe理 – > Web应用程序 – >pipe理Web应用程序 – >select您的Web应用程序 – >服务连接