Hi
I am trying to run a macro from a .xlsm file via my webpage using the Win32::OLE module.
use Win32::OLE;
use Win32::OLE::Const ('Microsoft Excel');
my $ex = Win32::OLE->new( 'Excel.Application', 'Quit' );
my $wkbk = $ex->Workbooks->Open('C:\test.xlsm') || die "could not open
+:$!";
$ex->Run('test');
$ex->{Visible} = 1;
$wkbk->SaveAs('C:\\SusTest2.xlsm') || die " could not save: $! " ;
if(-e 'C:\SusTest2.xlsm'){
print "file exists";
} else{
print "file not created";
}
When I run this as a .pl file it works. However when I try to do the same on my webpage, it dies on the open() call from the workbook object. Any idea as to why it is happening? Also how to check cause for the error for the Open() method in Win32::OLE?
I am not getting any error in the $! variable.