Hello, guys!

Can anyone help me with a strange thing? Access to PivotCaches method of Workbook object doesn't work in JScript and does in VB. WSH throws an exception "Object doesn't support this property or method"

This code doesn't work:

var excel = new ActiveXObject("Excel.Application");
var wb = excel.Workbooks.Add();

WScript.Echo( wb.pivotcaches.count );

But this code does:

set excel = CreateObject("Excel.Application")
set wb = excel.workbooks.add

WScript.Echo( wb.pivotcaches.count )

Either this is a bug somewhere in Excel automation or I am complete idiot...