Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win32::OLE Problem (using Excel)

Status
Not open for further replies.

timtrust123

Programmer
Dec 19, 2003
19
GB
I need to be able to turn off the automatic recalculation of a worksheet for updating.

All goes well creating object etc but i'm unable to turn off the updating.

Here is what I have so far.

#Create and Excel object - No problem here
$ex = Win32::OLE->new('Excel.Application', sub {$_[0]->Quit;});

#Open a book - No problem here
$book = $ex->Workbooks->Open ('C:\test.xls', {UpdateLinks => 0});

# Open sheet 1 - No problem here
$Sheet = $book->Worksheets(1);

# Set calculation to manual - problem here
$ex->{'Calculation'} = 'xlManual';

# error message
Unable to set the Calculation property of the Application class

Something is wrong with :$ex->{'Calculation'} = 'xlManual';
Can't see what.
Any help would be appreciated

Code extract below.

Cheers
Tim
 
Have you tried
Code:
$ex->{'Calculation'} = [b]'xlCalculationManual'[/b];
(not tested)

HTH

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top