Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 1.48 KB

invalid-use-of-addressof-operator.md

File metadata and controls

31 lines (19 loc) · 1.48 KB
title keywords f1_keywords ms.assetid ms.date ms.localizationpriority
Invalid use of AddressOf operator
vblr6.chm1107785
vblr6.chm1107785
96ce20a6-175e-a006-f0fe-98080d630c7f
11/19/2018
medium

Invalid use of AddressOf operator

The AddressOf operator modifies an argument to pass the address of a function rather than passing the result of the function call. This error has the following cause and solution:

  • You tried to use AddressOf with the name of a class method. Only the names of Visual Basic procedures in a .bas module can be modified with AddressOf. You can't specify a class method.

  • The procedure name modified by AddressOf is defined in a module in a different project.

  • You tried to modify the name of a DLL function or a function defined in a type library with AddressOf.

  • DLL and type library functions can't be modified with AddressOf. The procedure definition must be in a module in the current project. Move the definition to a module in this project or include its current module in the project.

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

See also

[!includeSupport and feedback]