Hi,
I think the password that SAP creates for Excel through that FM is for the complete file and is not based on edit of excel. You might have to achieve this by creating a MACRO within the same excel. Check the OLE usage in the below code sample, Might help you.
Cheers,
Arindam