문제

I have a problem with using ExcelService in Sharepoint 2010.

Case: I have a template Excel File, and i copied it to some folder and then tried to fill cells in new document:

This code creates a file:

SPList documents = Web4Documents.GetListEx("Lists/RequestDocuments");
SPFolder folder =            documents.RootFolder.SubFolders.Add(_formContext.Request.Number).SubFolders.Add("Docs");
string path = folder.ServerRelativeUrl.AddUrl("Document.xlsx");
SPFile document = Web4Documents.Files.Add(path, stream, null, true);

After that I open this file using Excel Service:

using (Workbook workbook = client.OpenWorkbook(_context._SiteOriginal.MakeFullUrl(DocumentPath)))
        {
            //workbook.SetCell("A1", "TEST");
            workbook.SetCellByCoords("List1", 1, 1, "test");
            workbook.Save();
        }

This is a implementation of workbook`s Save method:

public void Save()
    {
        try
        {
            _service.SaveWorkbook(_session);
        }
        catch (SoapException ex)
        {
            throw new ASUPTPException("SOAP exception message: {0}, ERROR_CODE:", ex.Message, ex.SubCode.Code.Name);
        }
    }

And I get SoapException: "An error occurred while attempting to save your workbook. As a result, the workbook was not saved". Error code: FileSaveGeneric

Template file is empty.

Can anybody tell me why..?

도움이 되었습니까?

해결책

The problem was solved by turning off all but one Excel Service in the cluster..

It is strange..but it works now

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top