3.1.4.57 AutoFit

This operation adjusts the heights of rows (2) or the widths of columns (2), in a workbook, if necessary, to fit the contents in those rows (2) or columns (2).

The following is the WSDL port type specification of the AutoFit WSDL operation.

 <wsdl:operation name="AutoFit" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
   <wsdl:input wsaw:Action="http://schemas.microsoft.com/office/Excel/Server/WebServices/ExcelServerInternalService/ExcelServiceSoap/AutoFit" message="tns:ExcelServiceSoap_AutoFit_InputMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:output wsaw:Action="http://schemas.microsoft.com/office/Excel/Server/WebServices/ExcelServerInternalService/ExcelServiceSoap/AutoFitResponse" message="tns:ExcelServiceSoap_AutoFit_OutputMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:fault wsaw:Action="http://schemas.microsoft.com/office/Excel/Server/WebServices/ExcelServerInternalService/ExcelServiceSoap/AutoFitExcelServerMessageFault" name="ExcelServerMessageFault" message="tns:ExcelServiceSoap_AutoFit_ExcelServerMessageFault_FaultMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
 </wsdl:operation>

The protocol client sends an ExcelServiceSoap_AutoFit_InputMessage request message, and the protocol server responds with an ExcelServiceSoap_AutoFit_OutputMessage response message, as follows:

  • If the value of isRow is set to be true, the protocol server sets the heights of the rows (2), specified in autoFitRange, to fit the largest content in those rows (2).

  • If the value of isRow is set to be false, the protocol server sets the widths of the columns (2), specified in autoFitRange, to fit the largest content in those columns (2).

In the event of an application error on the protocol server during this operation, a SOAP fault is returned, as specified in section 2.2.2. The Id element of the ExcelServerMessage SHOULD<74> be one of the values specified in section 2.2.2.1.