in reply to Re^3: Win32::OLE(0.1403) error 0x80070005: "Access is denied"
in thread Win32::OLE error 0x80070005: Access is denied
I will be calling the above subroutine in my program. It works fine in the command line prompt, while accessing thru the CGI script I found the above error. I Believe I have to provide some User Permissions to the Excel Application thru CGI, b'cos the error throws the line pointing to the Excel Object Creation. So please Help me in this issue#!C:/Perl/bin/perl.exe use strict; sub Export_Excel{ use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; # die on errors... my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); my $Book = $Excel->Workbooks->Open("D:\\Application\\tmp\\Report_Temp. +xls"); my $Sheet = $Book->Worksheets('Report_Temp'); $Sheet->Cells(15,2)->{'Value'}=''; $Sheet->Cells(15,1)->{'Value'}='Test Successfully'; $Book->Save(); $Book->Close; $Excel->quit(); }
|
|---|