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



The information in this article applies to:

  • Microsoft Excel for Windows 5.0

This article was previously published under Q113952

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.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbprb KB113952