With .ActiveSheet Dimension arrSourceData[6] arrSourceData[1] = "SELECT myexcel3.pageno, myexcel3.order_id, myexcel3.cust_id, myexcel3.emp_id, " arrSourceData[2] = "myexcel3.to_name, myexcel3.to_address, myexcel3.to_city, myexcel3.to_region, " arrSourceData[3] = "myexcel3.postalcode, myexcel3.to_country, myexcel3.ship_count, myexcel3.ship_via," arrSourceData[4] = "myexcel3.order_date, myexcel3.order_amt, myexcel3.order_dsc, myexcel3.order_net," arrSourceData[5] = "myexcel3.require_by, myexcel3.shipped_on, myexcel3.freight" arrSourceData[6] = " FROM myexcel3 myexcel3 ORDER BY myexcel3.pageno" .PivotTableWizard(xlExternal, ; @arrSourceData, ; "R1C1:R3C1", ; "PivotTable1",,,,,,,.F.,,,,, ; "ODBC;Driver={Microsoft Visual FoxPro Driver};"+; "DSN=;UID=;PWD=;SourceDB=c:\ddrive\TEMP;SourceType=DBF;"+; "Exclusive=No;BackgroundFetch=No;Collate=Machine;")Cetin