in reply to Win32::OLE disable calculation

Your problem seems to be a function of when, in Excel's boot order, commands are called.

use strict; use warnings; use Win32::OLE; use Data::Dumper; my $xl = Win32::OLE->new('Excel.Application'); $xl->{Visible} = 1; #my $wb = $xl->Workbooks->Add; print Dumper $xl->{Calculation}; $xl->{Calculation}=-4135; print Dumper $xl->{Calculation};

returns

X:\Data\Perl>1145425.pl $VAR1 = bless( do{\(my $o = 40621128)}, 'Win32::OLE::Variant' ); $VAR1 = bless( do{\(my $o = 40621128)}, 'Win32::OLE::Variant' );

But uncomment the line creating the workbook and you get

X:\Data\Perl>1145425.pl $VAR1 = -4105; $VAR1 = -4135;

which is, I think, what you want.

Regards,

John Davies

Replies are listed 'Best First'.
Re^2: Win32::OLE disable calculation
by Psylo (Novice) on Oct 20, 2015 at 14:05 UTC

    And ... it works ! I was opening the workbook few lines later but as the attribute work on the application I didn't check this... What a dummy error.

    Thank you a lot !