AutoFit Property

Microsoft Office Web Components Object Model

AutoFit Property

       

Spreadsheet or PivotTable objects: True if the overall size of the spreadsheet or PivotTable list is determined by the number of visible columns and rows. The row height and column width cannot exceed the value of the spreadsheet’s or PivotTable list’s MaxHeight and MaxWidth properties. The default value is True. If the AutoFit property is set to False, the overall size of the spreadsheet or PivotTable list is set based on its Width and Height properties. Read/write Boolean.

PivotAxisMember or PivotTotal objects: True if the width of the total is set automatically. The default value is True. When this property is set to True, any layout change also updates the Width and Height property values. When you change the Width and Height values programmatically, the value of the AutoFit property is set to False. Read/write Boolean.

expression.AutoFit

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

This example disables automatic sizing for the PivotTable list and then sets its width.

Sub DisableAutoFit()

   PivotTable1.AutoFit = False
   PivotTable1.Object.Width = 8000

End Sub