#!/usr/bin/perl -w use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; my $Excel; my $in_file_dgb = "e:/gen_ram_fifo_model/excel_list"; $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{DisplayAlerts} = 'False'; my $Book = $Excel->Workbooks->Open("$in_file_dgb/haha.xls"); my $worksheets_no = $Book->Worksheets->{Count}; undef $Book; undef $Excel;