Table of contents
TOC
Collapse the table of content
Expand the table of content

Definitions of property procedures for the same property are inconsistent

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

The parameters for Property Get, Property Let, and Property Setprocedures for the sameproperty must match exactly, except that the Property Let has one extra parameter, whose type must match the return type of the corresponding Property Get, and the Property Set has one more parameter than the corresponding Property Get, whose type is either Variant, Object, aclass name, or an object library type specified in anobject library. This error has the following causes and solutions:

  • The number of parameters for the Property Get procedure isn't one less than the number of parameters for the matching Property Let or Property Set procedure. Add a parameter to Property Let or Property Set or remove a parameter from Property Get, as appropriate.

  • The parameter types of Property Get must exactly match the corresponding parameters of Property Let or Property Set, except for the extra Property Set parameter. Modify the parameter declarations in the corresponding procedure definitions so they are appropriately matched.

  • The parameter type of the extra parameter of the Property Let must match the return type of the corresponding Property Get procedure. Modify either the extra parameter declaration in the Property Let or the return type of the corresponding Property Get so they are appropriately matched.

  • The parameter type of the extra parameter of the Property Set can differ from the return type of the corresponding Property Get, but it must be either a Variant, Object,class name, or a validobject library type.

    Make sure the extra parameter of the Property Set procedure is either a Variant, Object, class name, or object library type.

  • You defined a Property procedure with an Optional or a ParamArray parameter. ParamArray and Optional parameters aren't permitted in Property procedures. Redefine the procedures without using thesekeywords.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

© 2018 Microsoft