Chuck,
  Thanks for the response. Sorry about that. I sent the message out
before checking monks again.

1. I have MS Excel 2000 9.0.3821 SR-1.

2. The program was:

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
Win32::OLE->LastError();

print Win32::OLE->LastError();

The results  were:

C:\Documents and Settings\dln1\My Documents\White Papers\AANC>perl
test2.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,264,424,960 bytes free
Win32::OLE(0.1502) error 0x80070005: "Access is denied"
    in PROPERTYPUT "DisplayAlerts" at test2.pl line 17

C:\Documents and Settings\dln1\My Documents\White Papers\AANC>


Thanks,
Daniel

-----Original Message-----
From: Charbeneau, Chuck [mailto:CCharbeneau@;lear.com]
Sent: Wednesday, October 30, 2002 12:14 PM
To: '[EMAIL PROTECTED]';
[EMAIL PROTECTED]
Subject: RE: Excel, OLE, and Activestae PERL 5.6.1 rel 633 on Windows
2K.


> From: Daniel Needles [mailto:daniel.needles@;Callisma.com]
> Subject: Excel, OLE, and Activate PERL 5.6.1 rel 633 on Windows 2K.

> The following program:
[SNIP]
>
> C:\Documents and Settings\dln1\AANC>perl test.pl
>
>   Win32::OLE(0.1502) error 0x80070005: "Access is denied" in
> PROPERTYPUT "Visible" at test.pl line 6
>   Win32::OLE(0.1502) error 0x80070005: "Access is denied" in
> METHOD/PROPERTYGET "" at test.pl line 7
>   Can't call method "Open" on an undefined value at test.pl line 7.


I'll ask the same questions I asked on Perl Monks to this:

Do you have Excel Installed on this Machine?
What happens when you put error checking in?

<CODE>
use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';

$Win32::OLE::Warn = 3; # Die on Errors.

my $excelfile = 'book1.xls';

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
Win32::OLE->LastError();

print Win32::OLE->LastError();
</CODE>

Chuck Charbeneau

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to