Example : Read an Excel Worksheet from Perl using MacPerl

  • Thread starter gimme_this_gimme_that
  • Start date
G

gimme_this_gimme_that

This script reads the values in an open Excel Workbook.
If you wanted to use this script to parse a Workbook on disk you'd
modify the Applescript which is kept simple for this example:


#!/usr/bin/perl
use MacPerl::AppleScript;

my $app = MacPerl::AppleScript->new("Microsoft Excel");
$app->execute("launch");
my $vc= $app->execute("get value of formula of range \"A1:B3\" of
worksheet \"Sheet1\" of active workbook");

foreach my $ref (@{$vc}) {
#here, $ref is one of the "inner" references
foreach my $elem (@{$ref}) {
print "$elem ";
}
print "\n";
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top