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
|