PRB: Sub Name Can't Be Valid Cell Reference in Excel VBApp

Last reviewed: July 29, 1997
Article ID: Q113952
The information in this article applies to:
  • Microsoft Visual Basic, Application Edition, version 1.0
  • Microsoft Excel for Windows, version 5.0

SYMPTOMS

Certain Sub or Function procedure names may generate an "Invalid Procedure Name" error in Visual Basic, Applications Edition in Excel even though the syntax is correct.

CAUSE

When creating new modules or renaming existing modules in Excel, Visual Basic, Applications Edition rejects any Sub or Function that is a valid cell reference regardless of whether you are using A1 or R1C1 referencing.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new book in Excel by choosing New from the File menu.

  2. Insert a new module by choosing Macro and then Module from the Insert menu.

  3. Add the following code to the new module:

       Sub C3000
    
    

  4. When you press the ENTER key, you'll see the error "Invalid procedure name." Then the line of code turns red.
Keywords          : kberrmsg kbprg
Version           : 1.00
Platform          : WINDOWS


================================================================================


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: July 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.