meghavarshney has asked for the wisdom of the Perl Monks concerning the following question:
hiii any body tell me whats wrong with this prog... actually m trying to make a prog to delete blank cell form my excel sheet but m unable in it ...if u know then plz let me know. My code is
#!/usr/bin/perl -w use strict; use warnings; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; use Spreadsheet::WriteExcel; $Win32::OLE::Warn = 3; my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{Visible} = 1; my $Book = $Excel->Workbooks->Open("c:\\perl\\copy of BK11.xls"); my $Sheet = $Book->Worksheets(1); my $count=0; foreach my $row (1..3226) { foreach my $col (1..14) { if (!defined($Sheet->Cells($row,$col)->{'Value'})) { $Sheet->Cells($row,$col)->EntireRow->Delete; $count++; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to remove blank cell with perl
by SuicideJunkie (Vicar) on Aug 03, 2011 at 13:50 UTC | |
by meghavarshney (Novice) on Aug 03, 2011 at 17:09 UTC | |
|
Re: how to remove blank cell with perl
by moritz (Cardinal) on Aug 03, 2011 at 13:22 UTC | |
by meghavarshney (Novice) on Aug 03, 2011 at 13:31 UTC | |
by moritz (Cardinal) on Aug 03, 2011 at 13:45 UTC | |
|
Re: how to remove blank cell with perl
by davies (Monsignor) on Aug 03, 2011 at 17:23 UTC |