Click here to get back home

Spreadsheet::ParseExcel : read cell-notes

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Spreadsheet::ParseExcel : read cell-notes peter pilsl 05-27-2005
Posted by peter pilsl on May 27, 2005, 11:54 am
Please log in for more thread options



Is there any way to read the notes/comments attached to a cell using
SpreadSheet::ParseExcel or a different module? I searched CPAN and
google and didnt find any hints.

thnx,
peter



--
http://www.goldfisch.at/know_list


Posted by Jack D on May 28, 2005, 10:35 pm
Please log in for more thread options


>
> Is there any way to read the notes/comments attached to a cell using
> SpreadSheet::ParseExcel or a different module? I searched CPAN and
> google and didnt find any hints.
>
You can use Win32::OLE to do this:
######################################
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Excel';
use strict;

my $xl = Win32::OLE->GetActiveObject('Excel.Application') ||
Win32::OLE->new('Excel.Application');
die "Cannot start Excel" unless $xl;

my $workbook=$xl-> Workbooks->Open('C:\temp\book1.xls');
my $worksheet=$workbook->Worksheets('Sheet1');

my $LastRow = $worksheet->UsedRange->Find({What=>"*",
SearchDirection=>xlPrevious,
SearchOrder=>xlByRows})->;

my $LastCol = $worksheet->UsedRange->Find({What=>"*",
SearchDirection=>xlPrevious,
SearchOrder=>xlByColumns})->;

print "Number of used rows: $LastRow\n";
print "Number of used cols: $LastCol\n";

my $lnRow=1;
my $lnCol=1;

while ($lnRow <= $LastRow) {
$lnCol = 1 if ($lnCol > $LastCol);
my $notes = $worksheet->Cells($lnRow,$lnCol)->;
print $notes,"\n" if ($notes);
$lnRow++ if $lnCol == 1;
$lnCol++;
}

$xl->Quit;
__END__
###############################

hth -

Jack




Similar ThreadsPosted
Spreadsheet::ParseExcel November 16, 2006, 6:55 am
Spreadsheet::ParseExcel error on Perl 5.8.0 November 7, 2005, 6:02 am
FmtDefault-Warning in Spreadsheet-ParseExcel December 20, 2005, 10:50 am
Spreadsheet::ParseExcel::SaveParser changes formula text to value August 25, 2004, 9:52 am
Spreadsheet-ParseExcel: Parsing various MS Excel file versions / grabing checkbox values? September 17, 2004, 3:11 am
ANN: Spreadsheet::Read 0.15 June 21, 2006, 12:40 pm
ANN: Spreadsheet::Read 0.16 July 4, 2006, 7:01 am
Re: ANN: Spreadsheet::Read 0.16 July 4, 2006, 9:36 am
[ANN] Spreadsheet::Read 0.20 May 31, 2007, 9:38 am
Problem with Spreadsheet::Read June 8, 2006, 4:56 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap