Microsoft KB Archive/285810

= XL2000: Error Message 450 When You Run Sample Code from Excel 2000 Help to Change the Style of a Range =

Article ID: 285810

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition

-



This article was previously published under Q285810



SUMMARY
The Excel 2000 Visual Basic for Applications (VBA) Help topic for the Style object contains the following information:

Using the Style Object

Use the Style property to return the Style object used with a Range object. The following example applies the Percent style to cells A1:A10 on Sheet1.

Worksheets(&quot;sheet1&quot;).Range(&quot;a1:a10&quot;).Style.Name = &quot;percent&quot;

The code in the preceding documentation is incorrect. The Name property of the Style object is read-only. Therefore, the code causes the following error message to appear:

Run-time error '450':

Wrong number of arguments or invalid property assignment

To apply the Percent style to A1:A10 on Sheet1 as the sample intends, use the following code instead: Worksheets(&quot;sheet1&quot;).Range(&quot;a1:a10&quot;).Style = &quot;percent&quot;

Additional query words: 450

Keywords: kbbug kbdocerr kberrmsg KB285810

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.