[EMAIL PROTECTED] <> wrote:
> Mr Rickards et al-
> 
> I made a checker based on yours when the small function didn't work
> plugged into the full script. 
> 
> i get these errors
> 
> e:\lab reports\test45>rem information section is over, turning echo
> off. 
> Win32::OLE(0.1403) error 0x80020005: "Type mismatch"
>     in METHOD/PROPERTYGET "Worksheets" argument 1 at compinfo.pl line
> 400 
> Win32::OLE(0.1403) error 0x80020005: "Type mismatch"
>     in METHOD/PROPERTYGET "Worksheets" argument 1 at compinfo.pl line
> 400 e:\lab reports\test45> 
> 
> I'm not sure what is causing this.
> the subroutine contains line 400 (the equality check line) and is
> 
> ---code---
> sub ExistingWorksheet{
>   # this looks to see if a worksheet exists
>   my $test = $_[0]; # name to test for
>   my $ewb = $_[1]; # Excel WorkBook to look in
> 
>   for my $sn (1 .. $ewb -> Worksheets -> Count){
>     # for each sheet in the book
>     if($ewb -> Worksheets($a) -> { 'Name' } eq $test){
>       # if they are the same return true (postivie #) as the sheet
>       number return $a;

Where does $a come from? The loop control variable is $sn. The only
reason that you didn't get a compilation error (assuming you are using
strictures) is that $a and $b are special variables (see 'perldoc
perlvar'), which is a good reason not to use them outside of a sort
function.

>     }
>   }
> 
>   return 0; # if we get to this line it doesn't exist, return false }
> ---code---
> 
> due to use of strict, name cannot be a bareword

If you mean

$ewb->Worksheets($sn)->{Name}

then my experience differs, it works just fine with "use strict;".
Perhaps you are talking about something else.

> 
> full code w/psinfo & test report base file in link
> http://rapidshare.de/files/15980042/compinfo.zip.html 

Invisible to me, I'm afraid.

HTH

-- 
Brian Raven 



=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for the 
intended addressee(s). Unauthorised reproduction, disclosure, modification, 
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message do not 
necessarily reflect those of Atos Euronext Market Solutions.

L'information contenue dans cet e-mail est confidentielle et uniquement 
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. 
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail 
vous parvient par erreur, nous vous prions de bien vouloir prevenir 
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre 
systeme. Le contenu de ce message electronique ne represente pas necessairement 
la position ou le point de vue d'Atos Euronext Market Solutions.


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to