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

Function call on left-hand side of assignment must return Variant or Object

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

A function call can appear on the left side of an assignment, but only if the return value of the function is an Object or Variant. This error has the following cause and solution:

  • The return type of the function on the left side of the assignment isn't a Variant or Object. Change the return type. Note that if the return value is an object or a Variant that contains an object, the assignment is to the defaultproperty of the object. If the Variant returned isn't an object, the assignment has no effect.

  • Everything in the call is correct, however, it can't be completed. For example, you may be trying to set a property that can only be set at design time. Enter design mode and set the property in the Property window. Remove the code that tried to set the property programmatically.

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

© 2018 Microsoft