Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default PivotTableWizard

I am calling Excel to hold a series of database data and then create a pivot
table from it (VB from Visual studio 2008 using office interop). Works fine
on my development and test boxes (both have Office 2007). The target system
has Office 2003 and fails on the pivot table wizard.

'Create a Pivot Table - CAUSES an ERROR with Excel 2003 !
xlSheet2 = xlBook.Sheets("Sheet2")
xlSheet2.Name = "PivotTable"

Dim pivotTable As PivotTable = Nothing
Dim CourseList As PivotField = Nothing
Dim NatList As PivotField = Nothing
Dim NatSum As PivotField = Nothing
Dim pivotTableName As String = "Nationality Analsys"

' Add a pivot table to the worksheet.
Dim EndCell As String = "C" + RowNo.ToString
xlBook.PivotTableWizard(XlPivotTableSourceType.xlD atabase, _
xlSheet.Range("A1", EndCell), xlSheet2.Range("A1"),
pivotTableName, True, True, _
True, True, , , False, False, XlOrder.xlDownThenOver, 0)

' Set variables for used to manipulate the Pivot Table.
pivotTable = xlSheet2.PivotTables(pivotTableName)
CourseList = pivotTable.PivotFields(1)
NatList = pivotTable.PivotFields(2)
NatSum = pivotTable.PivotFields(3)

Format the Pivot Table.
'pivotTable.Format(XlPivotFormatType.xlReport2)
pivotTable.InGridDropZones = False

' Set a Row Field.
CourseList.Orientation = XlPivotFieldOrientation.xlColumnField
NatList.Orientation = XlPivotFieldOrientation.xlRowField
NatSum.Orientation = XlPivotFieldOrientation.xlDataField

' Set a Value Field.
NatSum.Orientation = XlPivotFieldOrientation.xlDataField
NatSum.Function = XlConsolidationFunction.xlSum


-------

So it seems that Excel 2003 does not have the pivotwizard. The question is
what can I use instead and what would work on both Office 2003 and 2008?


BR
Don C


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
PivotTableWizard help with VB circuit_breaker Excel Worksheet Functions 1 July 7th 09 02:08 PM
PivotTableWizard Using Csharp Arghad Arnaout Excel Programming 1 December 4th 07 03:23 PM
different between CreatePivotTable and PivotTableWizard Kam Excel Programming 0 June 29th 06 08:00 AM
PivotTableWizard using SQL Analysis Services Kam Excel Programming 0 June 29th 06 07:54 AM
PivotTableWizard SourceData question Microsoft Forum Excel Programming 3 February 26th 05 05:50 PM


All times are GMT +1. The time now is 05:08 PM.

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

About Us

"It's about Microsoft Excel"