in reply to export to excel in CGI

You may want to look at using Spreadsheet::WriteExcel for creating the Excel file.

You won't be able to automatically download the Excel file to a specific location unless you use some sort of Applet/ActiveX component, which every user would need to install. Since it is unlikely you will be able to force such a regime upon users, you may be better just including instructions for downloading the Excel file.

Martin