There are java libraries to manipulate Excel files but I would regard that as quite dangerous as you need to be version avare of bothe the library and the Excel file. Anyhow, you must be able to open the Excel file what will mean it is downloaded to your local system, probably in a temporary folder.
In all circumstances I see this as quite messy to do what you say. I would really separate the functionality as have Pega generate the data needed and have Excel programming be able to read this data and not have Pega (or any other program) direct manipulate excel sheets.
You could generate XML or cvs output and have a .net/Excel program read and do wht is needed with the data and then replace the attachment. You probably must run this in windows to get it working.