Spreadsheet::WriteExcel, Excel formula won't calculate

Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default Spreadsheet::WriteExcel, Excel formula won't calculate

    I'm using the module Spreadsheet::WriteExcel to write an Excel file
    from a Perl script which gets its date from a database. Some columns
    of the worksheet should contain formulas. In general the writing of
    formulas functions. When I open the Excel file the corresponding
    columns have been calculated. But in columns where I use the function
    SUMIF to calculate a mean value I'm having a problem. The formula is
    written to the corresponding cells, but when I open the Excel file the
    result is not calculated.

    In order to get the result I have to click in the cells formula
    editing field and then click onto the worksheet again. Each cell is
    formatted as a number. I really don't have a clue what is going wrong
    and what can I do against it.

    Maybe anyone has encountered the same problem...Any hints are welcome.

    Thanks in advance,

    Sven
    Sven Jungnickel Guest

  2. Similar Questions and Discussions

    1. Spreadsheet::WriteExcel
      Hi, I was hoping someone could advise me on an issue with files created with the Spreadsheet::WriteSheet module. I am creating file using the...
    2. ANNOUNCE: Spreadsheet::WriteExcel 2.03
      ====================================================================== ANNOUNCE Spreadsheet::WriteExcel version 2.03 has been uploaded to CPAN. ...
    3. ANNOUNCE: Spreadsheet::WriteExcel 2.01
      ====================================================================== ANNOUNCE Spreadsheet::WriteExcel version 2.01 has been uploaded to CPAN. ...
    4. Bad excel docs with Spreadsheet::WriteExcel::Simple
      I've been trying to create an excel document with SpreadSheet::WriteExcel::Simple on Windows 2000 Server, and open it with MS Excel 7.0 (old, I...
    5. Spreadsheet::WriteExcel formulas
      Hello, I use the module Spreadsheet::WriteExcel and have following effect by generating formulas .... # Formulas my $formel = $worksheet...
  3. #2

    Default Re: Spreadsheet::WriteExcel, Excel formula won't calculate


    "Sven Jungnickel" <Sven.Jungnickel@bmw.de> wrote in message
    news:f1b78cf3.0309170308.c984a1e@posting.google.co m...
    > I'm using the module Spreadsheet::WriteExcel to write an Excel file
    > from a Perl script which gets its date from a database. Some columns
    > of the worksheet should contain formulas. In general the writing of
    > formulas functions. When I open the Excel file the corresponding
    > columns have been calculated. But in columns where I use the function
    > SUMIF to calculate a mean value I'm having a problem. The formula is
    > written to the corresponding cells, but when I open the Excel file the
    > result is not calculated.
    >
    >
    > Maybe anyone has encountered the same problem...Any hints are welcome.
    >
    I've used this module for a few months now and found no problems of that
    sort. Please post your code (or a link to it)...

    Dom


    Domenico Discepola Guest

  4. #3

    Default Re: Spreadsheet::WriteExcel, Excel formula won't calculate

    Sven Jungnickel wrote:
    > I'm using the module Spreadsheet::WriteExcel to write an Excel file
    > from a Perl script which gets its date from a database.
    > ...
    > But in columns where I use the function
    > SUMIF to calculate a mean value I'm having a problem. The formula is
    > written to the corresponding cells, but when I open the Excel file the
    > result is not calculated.
    Spreadsheet::WriteExcel's formula parser doesn't always parse complex formulas
    correctly. Specifically it can incorrectly assign the class of certain reference
    tokens used internally by Excel.

    This will be fixed at a later stage when I get time to rewrite the formula
    parser.

    In the meantime, it is possible to post-process the output from the parser to
    correct this. Send me a short example program that demonstrates the problem
    and I'll let you know how to fix it.

    John.
    --
    perl -MCPAN -e 'install jmcnamara & _ x ord $ ;' | tail -1
    John McNamara Guest

  5. #4

    Default Re: Spreadsheet::WriteExcel, Excel formula won't calculate

    Hello,
    I realize it's a really old discussion but I'm having the same issue as Sven. I'm reading a CSV file with formulas in it, using $worksheet->write() function.
    example CSV:
    =========csv start
    a,b,c
    1,2,3
    1,4,6
    ,,=SUMIF(A2:A3, 1, C2:C3)
    ==========csv end

    the resulted xls opens just fine in OpenOffice but it does not calculate automatically in M$ Excel, as Sven described.

    @John
    You mentioned something about post-processing...
    I did a search but found nothing of that. I'm also very new to perl... I started learning yesterday for this task only - that was a compliment for the documentation of the module; as a beginner I managed to do a pretty complex xls file in no time.
    Thanks
    Liviu
    Liviu Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139