You may consider calling the wizard directly, without the Dialog, like
WITH .ActiveSheet
.Cells.Select
* syntax
*expression.PivotTableWizard(SourceType, SourceData, TableDestination, *TableName, RowGrand, ColumnGrand, SaveData, HasAutoFormat, AutoPage, *Reserved, BackgroundQuery, OptimizeCache, PageFieldOrder, *PageFieldWrapCount, ReadData, Connection)
*VBA code, as in MAcro
* ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:= _
* "Sheet1!R1C1:R637C31", TableDestination:="", TableName:="PivotTable2"
*VFP Code
.PivotTableWizard(xlDatabase, "Sheet1!R1C1:R637C31", "","PivotTable2")
ENDWITH
After that you may set other properties as you wish:
with .ActiveSheet.PivotTables("PivotTable2")
......
endwith
>Hi,
>
>how does one go about bringing up the pivot table wizard with non default properties already setup?
>
>
>#DEFINE xlDialogPivotTableWizard 312
>
>oXL = CREATEOBJECT("Excel.Application")
>oWB = oXL.Workbooks.add()
>oSheet = oWB.ActiveSheet
>oxl.Visible= .T.
>
>oxl.Dialogs(xlDialogPivotTableWizard).Show()
>
>
>this bring the default Wizard but apparently you could pass the show method a few parameters, which I'm unable to do - anyone with hints or code sample perhaps?
>
>From MS Site - xlDialogPivotTableWizard type, source, destination, name, row_grand, col_grand, save_data, apply_auto_format, auto_page, reserved
>
>So it looks like it's feasable, just don't know how to do it.
>
>TIA,
>
>Yanick