Is the exception occurring at loStringBuilder.ToString() or is it occuring somewhere in the CreateFileEncoding() method when the method attempts to do something with the string?
~~Bonnie
>>What's the exact code you're using to take that stringbuilder and put that string into a file?
>
>
> ' Save in a Xml file
> If Not oApp.CreateFileEncoding(loStringBuilder.ToString(), cFile, System.Text.Encoding.Unicode) Then
> cMessage = oApp.StrTran(cCannotCreateFile, "##File##", cFile)
> Return False
> End If
>