WriteExcel module, reopening a file
WriteExcel module, reopening a file
am 21.12.2007 07:33:36 von 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.
Re: WriteExcel module, reopening a file
am 21.12.2007 10:00:54 von Vakayil Thobias
wrote in message
news:24263fdb-9fa5-4ea9-bc08-e4b545f78f4e@t1g2000pra.googleg roups.com...
>
> 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.
I think it is not possible to open an excel sheet in perl for updation in
unix.
In windows, use Win32::OLE->GetActiveObject('Excel.Application') for read
and write operation.
Regards,
Thobias
Re: WriteExcel module, reopening a file
am 21.12.2007 12:42:10 von Tad J McClellan
dn.perl@gmail.com wrote:
>
> 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.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
Re: WriteExcel module, reopening a file
am 21.12.2007 15:51:13 von jmcnamara13
On Dec 21, 6:33 am, "dn.p...@gmail.com" wrote:
> 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.
--