編輯

共用方式為


_QueryTable.PreserveFormatting Property

Definition

This property is True if any formatting common to the first five rows of data are applied to new rows of data in the query table. Unused cells aren’t formatted. The property is False if the last AutoFormat applied to the query table is applied to new rows of data. The default value is True (unless the query table was created in Microsoft Excel 97 and the HasAutoFormat property is True, in which case PreserveFormatting is False). Read/write Boolean.

public:
 property bool PreserveFormatting { bool get(); void set(bool value); };
public bool PreserveFormatting { get; set; }
Public Property PreserveFormatting As Boolean

Property Value

Remarks

For database query tables, the default formatting setting is xlSimple.

The new AutoFormat style is applied to the query table when the table is refreshed. The AutoFormat is reset to None whenever PreserveFormatting is set to False. As a result, any AutoFormat that’s set before PreserveFormatting is set to False and before the query table is refreshed doesn’t take effect, and the resulting query table has no formatting applied to it.

Applies to