MOD2000: String Editor Evaluates Only Certain String Functions

ID: Q236476


The information in this article applies to:
  • Microsoft Office 2000 Developer

Moderate: Requires basic macro, coding, and interoperability skills.


SYMPTOMS

In the String Editor, if you try to include a line of code that contains one of the string functions, depending on which one you use, the String Editor may not recognize the string function and may simply return the string function unchanged.


CAUSE

The String Editor does not recognize all Visual Basic string functions. The String Editor evaluates and returns the answer only for the following six string functions:

  • Chr
  • Chr$
  • Chrb
  • Chrb$
  • Chrw
  • Chrw$


RESOLUTION

If you want to use the String$ function, for example, to create a string of fifty asterisks "*" in the Visual Basic Editor, follow these steps:

  1. On the View menu, click Immediate Window.


  2. In the Immediate window, type the following line, and then press ENTER:


  3. 
    ?String$(50,"*") 
  4. Copy the resulting string of asterisks from the Immediate Window and paste the string of asterisks where you need them.



STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the Visual Basic Editor.


  2. Insert a module and type the following text:


  3. 
    String$(50,"*") & Chrw(78) 
  4. Select to highlight the text.


  5. On the Add-ins menu, click String Editor.

    NOTE: If you do not see String Editor on the View menu, click Add-in Manager. In the Add-In Manager, click to select VBA String Editor, and then click to select the Loaded/Unloaded check box. This makes the String Editor available on the Add-Ins menu.

    Note that you see the following result in the String Editor:


  6. 
    String$(50,*)N 
Note that the Chrw$ function is evaluated with the correct answer of "N". However, the string function is not recognized and remains unchanged.


REFERENCES

For more information about the VBA String Editor, click the Help button in the String Editor.

Additional query words: pra

Keywords : kbdta modStringEditor
Version : :
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: November 19, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.