Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Spreadsheet::ParseExcel / WriteExcel question ....

by poj (Abbot)
on Nov 29, 2017 at 19:00 UTC ( [id://1204550]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Spreadsheet::ParseExcel / WriteExcel question ....
in thread Spreadsheet::ParseExcel / WriteExcel question ....

If you just want to modify a few cells on an existing spreadsheet then consider using Win32::OLE

#!perl use strict; use warnings; use Win32::OLE; use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; # Die on Errors. # config my $dir = 'c:\\temp\\'; my $file = 'test.xls'; my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{DisplayAlerts} = 0; #$Excel->{Visible} = 1; my $wb = $Excel->Workbooks->Open($dir.$file); my $ws = $wb->sheets(1); my $cell = $ws->Cells(1,1); $cell->{Value} = '567'; $cell->Interior->{Color} = rgbLightGreen; $cell->Font->{Color} = rgbDarkGreen; $wb->SaveAs($dir.'copy_'.$file); $wb->Close;
poj

Replies are listed 'Best First'.
Re^4: Spreadsheet::ParseExcel / WriteExcel question ....
by jhalbrook (Initiate) on Nov 29, 2017 at 20:41 UTC
    Will give this a try poj - thank you so much for your example. I figured I was just over-thinking things. :-0

    Joe

Log In?
Username:
Password:

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

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

    No recent polls found