Greetings to the forum

I have a form that I use to display a query in pivot table view.

The query is displayed w/in a subform on the form.

Am looking to export this pivot table to MS excel and retain the pivot table formatting.

Can a command button be used for this purpose?

If so can someone help out with the syntax?