I am using win32::Ole module to activate the excel application in the CGI mode,
during this process, I found and error saying Win32::OLE(0.1403) error 0x80070005: "Access is denied" at ...... line 7
but when i Tried to access the file on the Command Prompt the result was good.
#!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();
}
Here the File(Report_Temp.xls) was written by another Script using the Spreadsheet::WriteExcel module, Now I want to use Win32::Ole to write a sample data in the respective file, So I will call the above subroutine to invoke it but it throws the above error.
I Believe the Access denied is due to Permission provided to the Directory or File Created. In Unix machine we can change the permission by using the command "chmod" to the created file, Since I am using the win32 Perl with Apache running under Windows2003.I tried the above command in my script but it doesnt change the permissions.
I Searched for the "group" in the httpd.conf, But I am not able to find in it.
I am not much aware of WebServer Configuration, the File or Directory Permissions using perl or OLE and I have spent long hours trying to find the solution. Please Detail Explain is appreciated.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.