in reply to Running an excel macro from Perl

Lhamo_rin,

Did you use Super Search before posting this?
If you are using ActiveState Perl, using Win32::OLE:
#!/usr/bin/perl use strict; use Win32::OLE qw(in with); use Win32::OLE::Const; use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; my $filename = 'c:\\book_with_macros.xls'; my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32: +:OLE->new('Excel.Application', 'Quit'); my $Book = $Excel->Workbooks->Open( $filename ); $Excel->Run("MYMACRONAMEHERE"); $Book->Close;
N.B. The above code is untested.
Check out this article for more examples, including How do I convert a VBA macro to Perl?, which may interest you.

Hope this helps.

Martin