RSet allowed only on strings

RSet is used to right align string data within fixed-length or variable-length strings. This error has the following cause and solution:

  • You tried to use the RSet statement on a variable that isn't a string.

    If appropriate, try converting the variable to a string. Otherwise, don't use RSet.

    Note Although the LSet statement can be used to assign the elements of oneuser-defined type variable to the elements of a different, but compatible, user-defined type, such assignments are discouraged because they can't be guaranteed to be portable.

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.