0

I am using Spreadsheet::WriteExcel to write data into excel.
for each row I have used write_row().
When I try to write row having data (=) it throws an error saying:Couldn't parse formula: = ,since excel consider it as formula.
I need to write data using array as one row only so is there any way out to do the same?

Below is the code snippets:

use Spreadsheet::WriteExcel;
my $workbook  = Spreadsheet::WriteExcel->new("../tmp/op.xls");
my $worksheet = $workbook->add_worksheet();
my @data = ('1','1','=',"testdata");
$worksheet->write_row("A1", \@data);         
$workbook->close();

Output:

Couldn't parse formula: = at 

2 Answers 2

1

Look at the DIAGNOSTICS section of Spreadsheet::WriteExcel module document, it states that:

Couldn't parse formula ...

There are a large number of warnings which relate to badly formed formulas and functions. See the "FORMULAS AND FUNCTIONS IN EXCEL" section for suggestions on how to avoid these errors. You should also check the formula in Excel to ensure that it is valid.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks for the reply, but i want something tht works with write_row() function and avoid formula errors.
1

If you just want an equal sign in that cell and you can live with a little leading white space this will poke a '=' into that row without a formula error:

my @data = ('1','1', ' = ', "testdata");

Works in LibreOffice Calc too.

I'm curious how you intend using that = operator in the SS? Can you build a dynamic Excel formula by dereferencing a cell with an operator in it? Me not an Excel expert :-)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.