I understood that the workbook object is not defined since the $wrk_book->Open("file") failed. But the same script when executed independently as a .pl file works fine. I am calling this functionality on my webpage. Apart from this there is no other difference in the code. Appreciate any inputs.