This method of the Variant Class coerces the Variant object to a VT_UNKNOWN, VT_BSTR, VT_BOOL, or VT_R8 and returns the coerced result.
public native Object toScriptObject() throws ClassCastException;
Returns the coerced value converted to a Java type as follows:
VT_BSTR is converted to java.lang.String.
VT_BOOL is converted to java.lang.boolean.
Numeric types convertible by Variant.changetype to VT_R8 are converted to java.lang.double.
ClassCastException if the Variant object's type cannot be coerced.
This method was added as of versions 2437 through 2925 of the Microsoft virtual machine.