Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Pivot cache related-- vbscript code

Hi,

Few weeks back i had posted query related to reading data from excel having
pivot table(reference to the pivot table not know). The solution was:

Sub CreatePivot()
Dim pvtCache As PivotCache
'Dim shtNew As Worksheet

'get the pivot cache object of pivot table in Sheet1
Set pvtCache =
ActiveWorkbook.Worksheets("Sheet1").PivotTables(1) .PivotCache
'create a new pivot table in the sheet2 sheet
pvtCache.CreatePivotTable Sheet2.Range("A1").Address(True, True, xlR1C1, _
True), "pivottableX"
'add one data field
With Sheet2.PivotTables(1)
.AddDataField .PivotFields(1), "count", xlCount
End With
End Sub


Problem: I need to perform the whole task using vbscript in ASP.Net code. I
am getting error in last step i.e
With Sheet2.PivotTables(1)
.AddDataField .PivotFields(1), "count", xlCount
End With
Where as the whole code works fine when runas part of macro in excel.

Please help.

Thanks and Regards
Rishabh

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple pivot tables from 1 pivot cache sugargenius Excel Programming 0 February 22nd 07 07:41 PM
Pivot Cache Mike D. Excel Programming 1 December 28th 06 06:43 PM
reading pivot cache witek Excel Programming 1 July 10th 06 07:59 PM
Pivot cache Kreed Excel Discussion (Misc queries) 0 November 14th 05 09:17 PM
Pivot Cache Memory Jared Excel Programming 0 December 16th 04 04:31 PM


All times are GMT +1. The time now is 03:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"