Excel: CALL() and REGISTER() Functions Return #VALUE

Last reviewed: November 2, 1994
Article ID: Q51091

SUMMARY

Excel can call routines that have been compiled as CODE resources (sometimes referred to as dynamic-link libraries, or DLLs).

The REGISTER() function returns #VALUE! if the code is not successfully registered. Calling an unsuccessfully registered function likewise returns #VALUE!. You can see if a CODE resource has been successfully loaded into memory by viewing the macro sheet with display formulas turned off. If the code has been loaded, the REGISTER() function returns a text string used by the CALL() function.

A CODE resource may not load for any of the following reasons:

  1. The file containing the CODE resource is not in the specified directory. Excel looks for the file containing the CODE resource in the active directory if no path is specified. To ensure that the resource is found, always specify the path to the file containing the resource. Also, make sure the first argument in the REGISTER() function is enclosed in quotation marks and is the name of the file containing the resource, not of the resource itself.

  2. The routine has not been compiled as a CODE resource. Check that the routine has been compiled as a resource, with type CODE (all caps). Also check the spelling of the name of the resource and make sure it is enclosed in quotation marks. Finally, verify that the second argument in the REGISTER() function is the name given to the resource when setting the project type, not the name of the project, source file, or file containing the resource.

For more information on CODE resources, query on the following words:

   description and creating and code resource and call register
   and routine and floating point and decimal


KBCategory: kbother
KBSubcategory:

Additional reference words: 2.20 3.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.