suzun30 has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I am trying to run a macro from a .xlsm file via my webpage using the Win32::OLE module.
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.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"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Win32::OLE excel application macro execution
by Corion (Patriarch) on Apr 15, 2013 at 21:25 UTC | |
by suzun30 (Acolyte) on Apr 15, 2013 at 21:38 UTC | |
by Anonymous Monk on Apr 16, 2013 at 00:56 UTC | |
by suzun30 (Acolyte) on Apr 16, 2013 at 05:06 UTC | |
Re: Win32::OLE excel application macro execution
by NetWallah (Canon) on Apr 16, 2013 at 03:30 UTC |
Back to
Seekers of Perl Wisdom