Tutorial by Examples

#Modules to use use Cwd 'abs_path'; use Win32::OLE; use Win32::OLE qw(in with); use Win32::OLE::Const "Microsoft Excel"; $Win32::OLE::Warn = 3; #Need to use absolute path for Excel files my $excel_file = abs_path("$Excel_path") or die "Error: the file $Excel_path ha...
#Get the active Worksheet my $Book = $Excel->Activewindow; my $Sheet = $Book->Activesheet; #List of Worksheet names my @list_Sheet = map { $_->{'Name'} } (in $Book->{Worksheets}); #Access a given Worksheet my $Sheet = $Book->Worksheets($list_Sheet[0]); #Add new Worksheet...
#Edit the value of a cell (2 methods) $Sheet->Range("A1")->{Value} = 1234; $Sheet->Cells(1,1)->{Value} = 1234; #Edit the values in a range of cells $Sheet->Range("A8:C9")->{Value} = [[ undef, 'Xyzzy', 'Plugh' ], [ 42, 'Pe...
#Insert a row before/after line 22 $Sheet->Rows("22:22")->Insert(xlUp, xlFormatFromRightOrBelow); $Sheet->Rows("23:23")->Insert(-4121,0); #xlDown is -4121 and that xlFormatFromLeftOrAbove is 0 #Delete a row $Sheet->Rows("22:22")->Delete(); ...

Page 1 of 1