Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

This article was previously published under Q285810

↑ Back to the top


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("sheet1").Range("a1:a10").Style.Name = "percent"
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("sheet1").Range("a1:a10").Style = "percent"
				

↑ Back to the top


Keywords: KB285810, kberrmsg, kbdocerr, kbbug

↑ Back to the top

Article Info
Article ID : 285810
Revision : 6
Created on : 10/11/2006
Published on : 10/11/2006
Exists online : False
Views : 180