Microsoft Knowledge Base

TEXTREF() Returns #REF! If Filename Has Special Characters

Last reviewed: March 27, 1997
Article ID: Q135496
3.x 4.x 5.x 7.00 | 3.00 4.00 5.00 5.00a
WINDOWS          | MACINTOSH
kbusage

The information in this article applies to:

  • Microsoft Excel for Windows, versions 3.0, 4.0, 5.0 and 5.0c
  • Microsoft Excel for the Macintosh, versions 3.0, 4.0, 5.0 and 5.0a
  • Microsoft Excel for Windows NT, version 5.0
  • Microsoft Excel for Windows 95, version 7.0

SYMPTOMS

When you use the following Microsoft Excel 4.0 macro command with a filename that contains a special character, the macro will return a #REF! error:

   =TEXTREF(GET.DOCUMENT(1)&"!R1C1")

WORKAROUND

To work around this problem, do not use special characters in filenames.

MORE INFORMATION

The following table lists the special characters that will cause this problem.

   Character  Name of character
   ------------------------------

   `            Accent grave
   &            Ampersand
   *            Asterisk
   @            At symbol
   \            Backslash
   {}           Braces
   []           Brackets
   ^            Caret
   $            Dollar sign
   =            Equal sign
   !            Exclamation point
   /            Forward slash
   >            Greater than sign
   -            Hyphen
   <            Less than sign
   ()           Parentheses
   %            Percent sign
   |            Pipe symbol
   +            Plus sign
   #            Pound sign
   ~            Tilde

REFERENCES

For more information about TEXTREF, choose the Search button in Help and type:

    TEXTREF


KBCategory: kbusage
KBSubcategory:

Additional reference words: 3.00, 4.00, 5.00 5.00a 5.00c right left
opening closing
Keywords : kbusage
Version : 3.x 4.x 5.x 7.00 | 3.00 4.00 5.0
Platform : MACINTOSH 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: March 27, 1997
©1997 Microsoft Corporation. All rights reserved. Legal Notices.