Hello,
Thanks for all the help (especially Mr. Chuck.) I found the problem. This one is rather embarrassing, but interesting so I thought I'd let the group in on it.
I was racking my brain thinking what the hell could enforce permissions outside the standard Win2K user stuff. Then I remembered. A while back I installed Network Associates VirusScan Console software in order to be able to connect from the outside into my client site. I shut it off and reran the test. Worked like a charm.
Here's the pertinant diagnositic program:
CODE:
C:\Documents and Settings\dln1\My Documents\White Papers\AANC>type tes
+t2.pl
use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
$Win32::OLE::Warn = 3; # Die on Errors.
my $excelfile = 'C:\tmp\Book1.xls';
# VERIFY EXISTENCE
print "LISTING $excelfile\n";
print `dir $excelfile`;
my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
|| Win32::OLE->new('Excel.Application', 'Quit')
|| die Win32::OLE->LastError();
$Excel->{DisplayAlerts}=0;
#my $Book = $Excel->Workbooks->Open($excelfile) or die
my $Book = $Excel->Workbooks->Add() or die Win32::OLE->LastError();
Win32::OLE->LastError();
print Win32::OLE->LastError();
OUTPUT:
C:\Documents and Settings\dln1\My Documents\White Papers\AANC>perl tes
+t2.pl
LISTING C:\tmp\Book1.xls
Volume in drive C is LOCAL DISK
Volume Serial Number is 9C3D-51DA
Directory of C:\tmp
10/30/2002 10:17a 13,824 Book1.xls
1 File(s) 13,824 bytes
0 Dir(s) 8,263,262,208 bytes free
Win32::OLE(0.1502) error 0x80070005: "Access is denied"
in PROPERTYPUT "DisplayAlerts" at test2.pl line 17
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.