Hi Vijay,
Please, never use code from GOOGLE without understanding what are you doing! With EPM you need to use EPM protection. Look on the format sheet options and select appropriate cell locking. Then you have to use EPM protection that will protect cells with locked=on.
Vadim