mouleeshmichael has asked for the wisdom of the Perl Monks concerning the following question:
I want to detect whether any hyperlink is associated with a cell value in an excel file.How can i accomplish this?
I used Spreadsheet::ParseExcel::Cell and its method $cell->type() but it returns only text for a hyperlink.Is there any other method to detect its style?
use Spreadsheet::XLSX; use Spreadsheet::ParseExcel; my $excel = Spreadsheet::XLSX -> new ('Sample.xlsx'); foreach my $sheet (@{$excel -> {Worksheet}}) { printf("Sheet: %s\n", $sheet->{Name}); $sheet -> {MaxRow} ||= $sheet -> {MinRow}; foreach my $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { $sheet -> {MaxCol} ||= $sheet -> {MinCol}; foreach my $col ($sheet -> {MinCol} .. $sheet -> {MaxCol} +) { my $cell = $sheet -> {Cells} [$row] [$col]; if ($cell) { printf("( %s , %s ) => %s\n", $row, $col, $cel +l -> {Val}); my $type=$cell->type(); print $type."\n"; } } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: detect hyperlink in an excel file
by roboticus (Chancellor) on Dec 24, 2010 at 14:42 UTC | |
|
Re: detect hyperlink in an excel file
by Sinistral (Monsignor) on Dec 24, 2010 at 15:18 UTC | |
|
Re: detect hyperlink in an excel file
by davies (Monsignor) on Dec 24, 2010 at 15:51 UTC |