[kw-pm] Perl Question: debugging Win32::OLE / excel

Robert Pike robert at wisl.com
Fri Dec 9 07:47:35 PST 2005


Hi Daniel,
   I found the problem. It had to do with Excel not closing properly after the first itme 
and this message popping up each time after it got initialized. I do have another 
problem however. Setting the Visible property for the Excel application doesn't show 
Excel as it does when running from the DOS prompt. When trying to add a chart I hear 
the Excel help pop up (the beeping noise when the paper-clip helper pops up) but 
since I can't make the application visible I can't see what the helper is showing. 
Basically is there a way to make Excel visible here and (if not) how can I find out what 
the helper is prompting/asking for (is there a way to turn off this feature from coming up 
altogether)? Trying every discussion in the world for the past 2 days I'm uncertain if I 
am part of the mailing list. If possible could you do a quick check and, if I'm not, add me 
to it. Thanks so much for the help. Really appreciate it.  

Rob

On 8 Dec 2005 at 18:40, Daniel R. Allen wrote:

> Robert, I'm CCing your question to the local perlmongers' mailing list.
> 
> On Thu, 8 Dec 2005, Robert Pike wrote:
> 
> > Hi,
> >    I have a perl module created that basically opens a connection to excel does a little
> > song and dance to create a chart, and finally it should save the chart. I have a simple
> > perl script set up that all it does is pass the arguments to this module. When running
> > the application at the DOS prompt it works fine.
> >    I did the previous steps to test the module and see if it was working fine. I also have
> > another perl script that runs as a CGI and in it it also calls this module. The module
> > however fails in here. I'm using Win32::OLE. Each different session requires creating
> > an Excel chart so having created 1 spreadsheet in wwwroot or whatever is no good.
> > Basically here is the couple of lines that somewhere it fails:
> >
> > my $swExcel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE-
> > >new('Excel.Application', 'Quit');
> > $swExcel->{'Visible'} = 1;
> >
> > #=== Check to see if the data application exists ===
> > if (!(-r ("$wbFullDirectory$wbExcelData"))) { print "Cannot open the directory"; die; }
> > my $swDataWorkBook = $swExcel->Workbooks-
> > >Open("$wbFullDirectory$wbExcelData");
> >
> >     I normally get this error :
> > Can't call method "Open" on an undefined value at AppComm.pm
> > line 43.
> >
> >   I have put print/die statements before this error but they
> > don't get hit. I had gotten another error earlier regarding
> > lvalue, something like it can't accept an lvalue or no lvalue
> > was supplied but I can't get the error back. I'm using IIS 5.1
> > by the way just to give that extra bit of info. Thanks for any
> > help in advance.
> 
> I don't have any experience with IIS, but if the script works properly
> from the command-line but not from the webserver, it might be a
> permissions problem running under the webserver's user.  Is it possible to
> open a shell as the webserver's user, to test running it from there?
> 
> -Daniel
> 
> --
> http://coder.com/ - Prescient Code Solutions - (519) 575-3733 da at coder.com
> http://kw.pm.org/ - Kitchener-Waterloo Perl Mongers -         da at kw.pm.org
> 
> 
> > Rob
> > WISL while you work!
> >
> > Voice:519-884-2604
> > FAX:  519-884-0317
> > Mail: Waterloo Information Systems Limited
> >       33 Dupont Street East
> >       Waterloo ON
> >       N2J 2G8
> >
> >
> >
> 
> 
> 


WISL while you work!

Voice:519-884-2604
FAX:  519-884-0317
Mail: Waterloo Information Systems Limited
      33 Dupont Street East
      Waterloo ON
      N2J 2G8





More information about the kw-pm mailing list