The code is now clean without errors. I have tried to export the new file, but the excel file has only one sheet with Empty data. sad I did tried to export one of the xls file, and yes Im getting the one sheet with contents. Can anyone please help me out? I'm still new to Perl, so I don't have any idea what I did wrong in the code.