Can anyone tell me how to disable auto-calculation in Excel (used via
Win32::OLE) please?
You should use the "Object Browser" in the VBA editor to find out which
objects expose which properties etc.
I've found plenty of references to doing so in other languages,
It is usually a trivial matter to figure out how to express the same
thing in Perl
but for Perl, just some mailing list posts asking the
unless one spends all his time searching the web instead of thinking
about it.
In fact, it would have been useful for you to show how it is done in
other languages or at least provide a reference for the code you have
seen so we could be certain we are talking about the same thing.
same thing - and going unanswered, as far as the archive shows ...
That shall be no more, I hope.
#! /usr/bin/perl
use strict;
use warnings;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Excel';
my $excel;
eval {
$excel = Win32::OLE->GetActiveObject('Excel.Application')
};
die "$@\n" if $@;
unless(defined $excel) {
$excel = Win32::OLE->new(
'Excel.Application',
sub { $_[0]->Quit }
) or die "Oops, cannot start Excel: ", Win32::OLE->LastError, "\n";
}
$excel->Application->{Calculation} = xlCalculationManual;
__END__