DannyLondon
Programmer
Hello all
I am trying to create a pivot table in Excel, driven by JavaScript from my intranet page. The code works beautifully within VBA, but it keeps falling over on the PivotCache object in JS. The code is below. I would be very grateful for any suggestions on why this may be.
I have looked into the PivotTableWizard method, but I want to use the MSOLAP driver, and this is not possible for the wizard.
// Open Excel
objApplication = new ActiveXObject("Excel.Application.9"
objApplication.visible = true;
objBook = objApplication.Workbooks.Add()
wksReport = objBook.Worksheets(1)
wksReport.Name = "Report"
objPivotCache = objApplication.ActiveWorkbook.PivotCaches.Add(2, ""
// xlExternal
objPivotCache.Connection = Connection
objPivotCache.CommandType = 1 // xlCmdCube
objPivotCache.CommandText = "OCWCube"
objPivotCache.MaintainConnection = True
objPivotTable = objPivotCache.CreatePivotTable(Range("A1"
, "DrillDown"
Thanks
Danny...
I am trying to create a pivot table in Excel, driven by JavaScript from my intranet page. The code works beautifully within VBA, but it keeps falling over on the PivotCache object in JS. The code is below. I would be very grateful for any suggestions on why this may be.
I have looked into the PivotTableWizard method, but I want to use the MSOLAP driver, and this is not possible for the wizard.
// Open Excel
objApplication = new ActiveXObject("Excel.Application.9"
objApplication.visible = true;
objBook = objApplication.Workbooks.Add()
wksReport = objBook.Worksheets(1)
wksReport.Name = "Report"
objPivotCache = objApplication.ActiveWorkbook.PivotCaches.Add(2, ""
objPivotCache.Connection = Connection
objPivotCache.CommandType = 1 // xlCmdCube
objPivotCache.CommandText = "OCWCube"
objPivotCache.MaintainConnection = True
objPivotTable = objPivotCache.CreatePivotTable(Range("A1"
Thanks
Danny...