Out of string space (Error 14)

Visual Basic permits you to use very large strings. However, the requirements of other programs and the way you manipulate your strings may cause this error. This error has the following causes and solutions:

  • Expressions requiring that temporary strings be created for evaluation may cause this error. For example, the following code causes an Out of string space error on some operating systems:

      MyString = "Hello" 
      For Count = 1 To 100 
      MyString = MyString & MyString 
      Next Count 
    

    Assign the string to a variable of another name.

  • Your system may have run out of memory, which prevented a string from being allocated. Remove any unnecessary applications from memory to create more space.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.