WriteExcel module, reopening a file

D

dn.perl

I create an excel file 'myfile.xls' using WriteExcel module. It has a
tab named 'Name1', and its first (say) 10 rows have some data.

I would like to reopen this sheet for over/writing, and write a string
'new string' to its cell (10, 1). Or overwrite cell (2,2) with string
'new string'.

Now I can open a new excel sheet for writing, parse the old file cell
by cell, copy each cell to the new file's sheet(s), and add a new
string to a 'new' cell, and overwrite a copied cell, and then rename
the new sheet as 'myfile.xls'. But I am interested in knowing whether
the module WriteExcel (or a Win32 module) allows me to reopen an
existing excel file for over/writing.

TIA.
 
T

Tad J McClellan

I create an excel file 'myfile.xls' using WriteExcel module.

I would like to reopen this sheet for over/writing, and write a string
'new string' to its cell (10, 1). Or overwrite cell (2,2) with string
'new string'.
But I am interested in knowing whether
the module WriteExcel (or a Win32 module) allows me to reopen an
existing excel file for over/writing.


Have you read the documentation for the module that you are using?

This module cannot be used to write to an existing Excel file.


When I needed to do a similar thing at work[1], the only solution I
could find was to use the POI Java library.

http://poi.apache.org/


After a few days of Java programming, I needed to lick dirt to
get the bad taste out of my mouth. :)



[1] And it needed to run on a Linux web server, so win32 modules were not an option.
 
J

jmcnamara13

I create an excel file 'myfile.xls' usingWriteExcelmodule. It has a
tab named 'Name1', and its first (say) 10 rows have some data.

I would like to reopen this sheet for over/writing, and write a string
'new string' to its cell (10, 1). Or overwrite cell (2,2) with string
'new string'.


Hi,

See the following Spreadsheet::WriteExcel FAQ. "How do I update an
existing Excel file":

http://groups.google.com/group/spreadsheet-writeexcel/browse_frm/thread/15e131d2f5d012b4

Note you will have to patch the latest version of SaveParser to get it
to work (see link below) or put a "use Spreadsheet::parseExcel;" at
the top of your program.

http://rt.cpan.org/Public/Bug/Display.html?id=31380

John.
--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top