Excel VBA - How to convert an Object into a String
<p>I like to convert an Object into a string. I found this <a href="https://codereview.stackexchange.com/questions/78797/representing-objects-as-strings-in-vba">topic</a> but I can not get it to work in Excel 2010 ("Cast.xxx", "CArray()" and "Array()" seems to be unknown to Excel?)</p>

<p>I know how to convert a variant e.g. "toString = CStr(x)"  but not how to do it the best way for an object</p>

<pre><code>Function toString(ByVal x As Variant) As String
  If TypeOf x Is Object  Then
      toString = ???   
  Else
      toString = CStr(x)
  End If
End Function
</code></pre>

<p>any suggestions?</p>