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.

Run-time error using FormulaArray property


View products that this article applies to.

Symptoms

When you try to create an array formula by using a Visual Basic for Applications macro, you may receive the following error message:
Run-time error '1004':
Unable to set the FormulaArray property of the Range class.

↑ Back to the top


Cause

This problem occurs when you try to pass a formula that contains more than 255 characters, and you are using the FormulaArray property in Visual Basic for Applications.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


More information

An array formula can perform multiple calculations and then returns either a single result or multiple results. You create array formulas the same way that you create basic, single-value formulas. However, with an array formula, after you create the formula, instead of entering the formula by pressing the ENTER key, you enter the formula by pressing the CTRL+SHIFT+ENTER keys.

An array formula can be identified by the braces ({}) surrounding the formula. To create an array formula in Visual Basic for Applications, you can use the FormulaArray property. However, you cannot create a formula that has more than 255 characters by using this property. Note that the Formula property in Visual Basic for Applications does not have this limit.

↑ Back to the top


References

For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
213841 Passed strings longer than 255 characters are truncated
212172 "Unable to record" message when recording a macro
For more information about the FormulaArray property, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type FormulaArray in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

↑ Back to the top


Keywords: KB213181, kbpending, kberrmsg, kbbug

↑ Back to the top

Article Info
Article ID : 213181
Revision : 6
Created on : 9/20/2010
Published on : 9/20/2010
Exists online : False
Views : 648