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";
}
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";
}