ExcelService.SaveWorkbookCopy Method
SharePoint 2010
Saves a workbook using a different file name and/or to a different SharePoint document library.
Assembly: Microsoft.Office.Excel.Server.WebServices (in Microsoft.Office.Excel.Server.WebServices.dll)
[WebMethodAttribute] public void SaveWorkbookCopy( string sessionId, string workbookPath, WorkbookType workbookType, SaveOptions saveOptions, out Status[] status )
Parameters
- sessionId
- Type: System.String
The Excel Web Services session ID.
- workbookPath
- Type: System.String
The location of the workbook file to open. Must be an absolute path.
Maximum size is 4096 characters.
- workbookType
- Type: Microsoft.Office.Excel.Server.WebServices.WorkbookType
Defines the different modes (Full Workbook, FullSnapshot, and PublishedItemsSnapshot) used to get a workbook. Also see the WorkbookTypeenumerator.
- saveOptions
- Type: Microsoft.Office.Excel.Server.WebServices.SaveOptions
Specifies whether to overwrite an existing file. If true to overwrite; otherwise false.
- status
- Type: Microsoft.Office.Excel.Server.WebServices.Status[]%
Alert information.
This method only saves to a SharePoint document library in the same domain. The workbookPath cannot be a UNC file path. The document library must be a trusted location. This method works in view or in edit mode.
You can specify the workbook file format (.xlsx, .xlsb, .xlsm) as part of the file name. This method does not close the session. To close the session, you must explicitly call the CloseWorkbook(String, Status[]) method.
This method preserves the workbook settings on recalculation before saving the workbook. To change workbook settings, use the SetCalculationOptions(String, WorkbookCalculation, Status[]) method.