in reply to Re: Spreadsheet::WriteExcel cell formatting.
in thread Spreadsheet::WriteExcel cell formatting.

I want it to be formatted as a string. and i am passing the formatting parameter on the actual script, the green warning triangle still appears.

  • Comment on Re^2: Spreadsheet::WriteExcel cell formatting.

Replies are listed 'Best First'.
Re^3: Spreadsheet::WriteExcel cell formatting.
by fishmonger (Chaplain) on Sep 22, 2015 at 19:50 UTC

    I just ran a test using your code snippet and couldn't reproduce your problem.

    Maybe the problem is due to some other portion of code in your script?

Re^3: Spreadsheet::WriteExcel cell formatting.
by SimonPratt (Friar) on Sep 23, 2015 at 16:04 UTC
    I want it to be formatted as a string

    Then your only option is to muck around with Excel itself (either a different version, or some macro to get rid of the warning).

    From what you describe, you want the cell to be formatted as text, however Excel is detecting that there is a number in the cell formatted as text and is attaching a warning to the cell indicating this. There is nothing Perl can do about that.

    fishmonger's previous suggestion to correctly format the cell is the only way Perl can affect the warning triangle you are seeing in Excel.

      well thats a bummer, i was hoping to be able to do all of this from a perl script. Thanks for the help.

Re^3: Spreadsheet::WriteExcel cell formatting.
by soonix (Chancellor) on Sep 24, 2015 at 08:11 UTC
    If you tell Excel it should be treated as string, you actually forbid Excel to use it in calculations. That's why it doesn't want to work the way you want.

    Of course, you could write an Excel-alike in Perl. A CPAN search finds Spreadsheet::Perl, Tk::TableMatrix::Spreadsheet and others.