Microsoft KB Archive/236476

= MOD2000: String Editor Evaluates Only Certain String Functions =

Article ID: 236476

Article Last Modified on 11/22/2002

-

APPLIES TO


 * Microsoft Office 2000 Developer Edition

-



This article was previously published under Q236476



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:  On the View menu, click Immediate Window.  In the Immediate window, type the following line, and then press ENTER: ?String$(50,"*")  Copy the resulting string of asterisks from the Immediate Window and paste the string of asterisks where you need them.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Open the Visual Basic Editor.</li>  Insert a module and type the following text: String$(50,"*") & Chrw(78) </li> Select to highlight the text.</li>  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: String$(50,*)N </li></ol>

Note that the Chrw$ function is evaluated with the correct answer of "N". However, the string function is not recognized and remains unchanged.

<div class="references_section">