use Win32::OLE; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Word'; $Win32::OLE::Warn = 2; # Throw Errors, I'll catch them ################################# Get the word object ################ my $word = Win32::OLE->GetActiveObject('Word.Application') || Win32::OLE->new('Word.Application', 'Quit'); #get the word object $word->Documents->Add || die("Unable to create document ", Win32::OLE->LastError()); ################## Call the vad macro to create table ##### $word->AddIns->Add({Filename=>"$cur_dir\\vad.dot", Install=>"True"}); #$word->run("vad") #running fine $word->run("vad", "D:\\Prasad\\Projects\\tools\\vad"'); #getting error #### OLE exception from "Microsoft Word": Unable to run the specified macro Win32::OLE(0.1707) error 0x80020003: "Member not found" in METHOD/PROPERTYGET "run" at D:\Prasad\Projects\tools\vad\vad.pl line 314 #### sub vad(path as string) { }