Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Spreadsheet::SaveParser - how to preserve formulas during parse, evaluate during write ?

by jmcnamara (Monsignor)
on Jan 08, 2010 at 23:51 UTC ( [id://816422]=note: print w/replies, xml ) Need Help??


in reply to Spreadsheet::SaveParser - how to preserve formulas during parse, evaluate during write ?


I am the current maintainer of Spreadsheet::ParseExcel.

Excel stores formulas in two parts. The first in a pre-parsed stack of RPN tokens that the Excel formula parser uses and the second is the value of the formula when it was last evaluated (generally when the workbook was saved).

Spreadsheet::ParseExcel ignores the first part (a general deparser is a little too tricky to implement) and just reads the result part. This is usually okay for applications that read an Excel file but isn't very useful if you are trying to re-write a file since the formula is effectively lost. This is currently the case with Spreadsheet::ParseExcel::SaveParser.

So it isn't the case that your formulas aren't being evaluated at the right time. They aren't evaluated at all.

Currently, there isn't a workaround for this. I have some plans for solutions that might be implemented in the future but they are either non-trivial or potentially error prone and neither will happen in the short term, unfortunately.

--
John.

  • Comment on Re: Spreadsheet::SaveParser - how to preserve formulas during parse, evaluate during write ?

Replies are listed 'Best First'.
Re^2: Spreadsheet::SaveParser - how to preserve formulas during parse, evaluate during write ?
by Anonymous Monk on Jan 24, 2012 at 09:44 UTC
    Hi, i am using SaveParser to parse an existing spreadsheet and i am trying to add formula, its giving the following error. Please let me know the reason, because the same write_formula works fine with WriteExcel. Can't locate object method "write_formula" via package "Spreadsheet::ParseExcel::SaveParser::Worksheet" With regards, Suresh.K

      Spreadsheet::ParseExcel::SaveParser::Worksheet is not a subclass of Spreadsheet:WriteExcel::Worksheet so it doesn't have a write_formula() method.

      Spreadsheet::ParseExcel::SaveParser does return a Spreadsheet:WriteExcel object that you can use to access the write_formula() method instead.

      P.S. Please don't post new questions in reply to a thread that your question isn't related to.

      --
      John.

        Hi John, Thanks. I will open a new thread.

        John,
        
        Sorry for posting on the same thread, since I could not find any other related thread.
        
        Could you please give an example of writing formulas in Saveparser. I tried few things, all in vain. So please elaborate on the above mentioned solution.
        
        --
        Sonal
        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://816422]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-25 22:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found