#!/usr/bin/perl use strict; use warnings; use Win32::OLE; use Win32::OLE::Const 'Microsoft Excel'; use Win32::OLE::Variant; my $exlM = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new( 'Excel.Application', sub { $_[0]->Quit; } ) or die "Can't attach to excel"; $exlM->{'Visible'} = 1; $exlM->{DisplayAlerts} = 0; my $workbook = $exl->Workbooks->open('D:/Perl/view_dataM'); my $sheet = $workbook->Worksheets(1); $sheet->cells( $a, 4 )->{Value} = "Value"; $workbook->SaveAs( { Filename => 'D:/Perl/view_dataM', FileFormat => xlWorkbookNormal } ); $workbook->Close(); $exlM->Quit();