Thanks sir for replying back pon my post yesterday .I read your question and one query strike in my curious mind is that , 'As per your reply I am not getting rights to generate an excel file but when I execute the same program in command line then I can generate the excel file at the same location where I am running that script Why is it so ?'