madhu has asked for the wisdom of the Perl Monks concerning the following question:

Hello everyone, I am new to perl and also to this site. I am trying to develop a script to convert an excel file into different html tables. I am able to convert the excel sheet in to different html output. But I am not able to retain the cell formatting, like the character font and styles. Can anyone provide how to proceed and if possible a sample code to retain the formatting, so that I can build on that. Thank you, Madhu. I wasn't logged in, so posted the thread again. Sorry about that.
  • Comment on excel file parsing with formatting retention

Replies are listed 'Best First'.
Re: excel file parsing with formatting retention
by jimX11 (Friar) on Aug 14, 2008 at 15:42 UTC
Re: Excel parsing with formatting retention
by jethro (Monsignor) on Aug 14, 2008 at 15:40 UTC

    You might like to read How do I post a question effectively?. Please be more specific, post some code, show what you have done. Do you use a module and if yes, which one? Have you problem finding the style information in the excel, or converting it to html or finding the right approximations in html?

Re: excel file parsing with formatting retention
by nbartusi (Scribe) on Aug 15, 2008 at 14:44 UTC
    You could use Excel to SaveAs a html file.
    my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application'); $Excel->{'Visible'} = 0; #0 is hidden, 1 is visible $Excel->{DisplayAlerts}=0; #0 is hide alerts my $Book = $Excel -> Workbooks -> Open ("test.xls") or die "Can't open + spreadsheet\n$!\n"; my $HTMLFormat = 44; # or ‘xlHtml’ $Book->SaveAs($htmlfile, $HTMLFormat);