This is the second time in two days that I will recommend Win32::OLE to you. I've never used Spreadsheet::WriteExcel because it does not do (or not well, at least) the things you are trying to do. Please spend some time with Win32::OLE -- you'll be much better off.