While saving the excel file (or 'Save As' for already saved files) when the Browse window appears asking file name, type, location etc : there is a 'tools' dropdown select just at the left of the save button. Click on it and select: 'General Options'. A mini option window appears with 'Backup Creation' / 'Password Protection' and a check box called 'Read Only Recommended'. Check that option and save your file. Thats all.
How is it related to any programming, by the way?