The following link shows how to launch a Print Program via code. You could just double it up. Once to print the PDF and another to create the Excel file
You’d want to change the line:
soa.ReportData.SalesOrderAckParam[0].AutoAction = "PREVIEW";
EDIT
Fixed the link