Compartilhar via


ExcelService.SaveWorkbook Method

Saves a workbook in the original format (.xlsx, .xlsb, .xlsm).

Namespace:  Microsoft.Office.Excel.Server.WebServices
Assembly:  Microsoft.Office.Excel.Server.WebServices (in Microsoft.Office.Excel.Server.WebServices.dll)

Syntax

'Declaration
<WebMethodAttribute> _
Public Sub SaveWorkbook ( _
    sessionId As String, _
    <OutAttribute> ByRef status As Status() _
)
'Usage
Dim instance As ExcelService
Dim sessionId As String
Dim status As Status()

instance.SaveWorkbook(sessionId, status)
[WebMethodAttribute]
public void SaveWorkbook(
    string sessionId,
    out Status[] status
)

Parameters

  • sessionId
    Type: System.String

    The Excel Web Services session ID.

  • status
    Type: []

    Alert information.

Remarks

You can only use this method in an edit mode session. You can join an existing edit session and be in collaboration mode. This method does not close the session. To close the session, you must explicitly call the CloseWorkbook(String, []) method.

The SaveWorkbook(String, []) method triggers the auto save behavior, that is, the in-built periodical saving of the workbook that happens in the background. If an auto save is already in progress, the SaveWorkbook(String, []) method will cause another auto save immediately following the completion of the in progress auto save.

This method preserves the workbook settings on recalculation before saving the workbook. To change workbook settings, use the SetCalculationOptions(String, WorkbookCalculation, []) method. This behavior differs from the background auto save which does not cause a recalculation before saving the workbook.

See Also

Reference

ExcelService Class

ExcelService Members

Microsoft.Office.Excel.Server.WebServices Namespace