Width Property

Applies To

Application object, Axis object, ChartArea object, ChartObject object, ChartObjects collection object, Legend object, LegendEntry object, LegendKey object, OLEObject object, OLEObjects collection object, PlotArea object, Range object, Shape object, ShapeRange collection object, Window object.

Description

Returns or sets an object's width, in points. Read/write Long, except as shown in the following table.

Remarks

The meaning of the Width property depends on the specified object.

Object

Description

Application

The distance from the left edge of the application window to the right edge of the application window.

Axis, LegendEntry, LegendKey

The width of the object. Read-only.

Range

The width of the range.

Window

The width of the window. Use the UsableWidth property to determine the maximum size for the window.

You cannot set this property if the window is maximized or minimized. Use the WindowState property to determine the window state.

ChartArea, ChartObject, Legend, OLEObject, PlotArea, Shape, ShapeRange, Window

The width of the object.


On the Macintosh, Application.Width is always equal to the total width of the screen, in points. Setting this value to any other value has no effect.

In Windows, if the window is minimized, Application.Width is read-only and returns the width of the window icon.

See Also

Height property, Left property, Top property.

Example

This example sets the width of the embedded chart.

Worksheets("Sheet1").ChartObjects(1).Width = 360
This example expands the active window to the maximum size available (assuming that the window isn't maximized).

With ActiveWindow
    .WindowState = xlNormal
    .Top = 1
    .Left = 1
    .Height = Application.UsableHeight
    .Width = Application.UsableWidth
End With