Export Access Pivot table to Excel via VBA

  • Thread starter Thread starter Will
  • Start date Start date
W

Will

I have a macro that open a from as a pivot table and
exports to Excel in pivot table format. I converted the
code to VB, but when I run it, I get a run time error 2501
on line 2. How do I fix this. Thanks

Code
DoCmd.OpenForm "Form_Name",_
acFormPivotTable, "", "", , acNormal
DoCmd.RunCommand acCmdPivotExportToExcel 'error is here
 
Back
Top