in reply to export a table to excel

What do you want to do exactly? Because there are more possibilities to do it:

If it it a Win32-System, you can do so with Win32::ODBC or DBI and DBD::ODBC very easily. Just access Excel like a ODBC-Database, and use the single sheets like tables. Just take care that the Sheetname plus a $ at the end is the tablename.

Or you could use Win32::OLE (have a look at the activestate perl-WinFaq). This has got more overhead, but if you want to format cells or build and execute makros, this might be the only way how it works.

There are also Modules like Excel::Spreadsheet or the like, but I haven't tried them yet.

Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"

Replies are listed 'Best First'.
Re: Re: export a table to excel
by Caillte (Friar) on Feb 26, 2002 at 17:05 UTC

    When I had thsi problem on a linux system I used DBD::CSV to create a tab-seperated database and then used $cgi->redirect to change to it. Systems with Excel installed will treat files with a .csv extension as spreadsheets and convert them to Excel format when loading.

    The only problem with this is it will only transmit data, no fancy formatting ;)

    This page is intentionally left justified.

      Actually, you can really ensure the browser will send it to Excel by sending a content type of application/vnd.ms-excel, even for tab-delimited files. This has worked reliably for me across three versions of Excel.

      Chris
      M-x auto-bs-mode