You need to keep in mind, that you're handling values returned from an ActiveXObject. ActiveXs are not written with JavaScript (often used languaes are for example C, C++ or #C), hence they have not prototype
, and are not implementing any ECMA-Script standards. The type of the returned value may vary, also the return value may be a type of not known in JS.
In your case it looks like you'd get a value from a cell containing an Excel Date object. Unlike JS, Excel has also native Date datatype, which JS's typeof operator seems to be able to read.
To get a string from an ActiveX property, you can do
var str = new String(ActiveX.property);
This is not bullet proof, but it has worked for me everywhere I've used it.