[EMAIL PROTECTED] wrote:
Mr. Rickards, MR. Raven et al-

I still get some errors and i'm not sure why on the OLE ones. It is not saving/closing on either version, operating on previously existing nore building new.

I'm going to try and go thru the bughunting process, with
references to pertinent documentation. This OLE stuff
is just like riding a bike: Once you get the hang
of it, you can get real good at it, yet still run the
risk of falling off and breaking your neck ;-)


operating on existing:

Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

e:\>cd "lab reports"

e:\lab reports>cd test45

e:\lab reports\test45>cataloge.bat

e:\lab reports\test45>rem this batch is for cataloguing computers using two other "helpers"

e:\lab reports\test45>rem "helpers" are psinfo and compinfo

e:\lab reports\test45>rem information section is over, turning echo off.
testing 'Sheet1' against 'General - 2006-Mar-20'


--repeated output messages snipped--

First suggestion: Test code requiring use of unfamiliar methods
a piece at a time on test or hardcoded data, rather than
try to develop the whole application in one go ;-)


OLE exception from "Microsoft Excel":

Unable to get the Add property of the Sheets class

Win32::OLE(0.1403) error 0x800a03ec
    in METHOD/PROPERTYGET "Add" at compinfo.pl line 171
e:\lab reports\test45>

When you get a message like this it really is telling you
something useful: You have attempted to use a method
inappropriately on a class...

It also provides the class name - 'Sheets'

Documentation is built right into Excel, as long as you chose
to install the Visual Basic option:

Tools->Macros->Visual Basic Editor.

Mouse right-click over main project edit pane to
get menu->Object Browser

At the top of the Object Browser there are two
dropdown entry widgets. Top one is Project/Library,
select Excel to filter on only Excel objects.

Below that is the 'search' widget. Type 'add' and
hit the search button to the right.

Now in the 'Search Results' frame you have everything pertaining
to Add. Scroll down to find 'Save' in the member column.

Select that line, and in what I'll call the helper frame, you see:

Function Add([Before], [After], [Count], [Type]) As Object
    Member of Excel.Worksheets



------------------------------------------------------------
line 171: $ws1 = $Excel -> Worksheets -> Add({After => $ls}); # add as last sheet

So, after reading the error message and your line above,
you can see that your basic syntax here is good. There must
be something wrong with the content. What is $ls?


surrounding area (161-181)
  my $ws3t="Applications - $date";

  # check for sheets
  my $ws1n = &ExistingWorksheet($ws1t,$report);
  my $ws2n = &ExistingWorksheet($ws2t,$report);
  my $ws3n = &ExistingWorksheet($ws3t,$report);

  # make the sheets for today if they do not exist
  unless($ws1n){
    my $ls = $report->Worksheets->{Count}; # get last sheet
$ws1 = $Excel -> Worksheets -> Add({After => $ls}); # add as last

Check the example I provided the other day:

my $sheetCount = $Book->Worksheets->{Count};
my $lastSheet = $Book->Worksheets($sheetCount);
$Book->Worksheets->Add({After => $lastSheet})->{NAME} = 'End Sheet';

So...$ls contains simply the number of sheets in the book,
which is why the Add routine has trouble with it, when
it expects an object reference to the last sheet with the
'After' parameter.

You omitted the call to get that object ($lastSheet in my example)

sheet
    $ws1 -> {'Name'} = "General - $date";
  }else{
    $ws1 = $report -> Worksheets($ws1n);
  }
  unless($ws2n){

-- Lots of script output errors or warnings snipped
though it looks like data returned from system calls
may be suspect and needs serious validation...

Two quite separate OLE errors here. First points to
line 283 which you don't provide, but suggest you investigate
documentation, script syntax and value of variables
used - note in 'METHOD/PROPERTYGET "" at compinfo.pl' it
looks like you have an empty variable in there (the empty "" quotes)

The system cannot find the file specified.
The system cannot find the file specified.
retrying default method at /PerlApp/Win32/OLE/Lite.pm line 156.
Win32::OLE(0.1403) error 0x8002000b: "Invalid index"
    in METHOD/PROPERTYGET "" at compinfo.pl line 283
testing 'General - 2006-Mar-20' against 'General - 2006-Mar-20'

testing 'General - 2006-Mar-20' against 'Hotfixes - 2006-Mar-20'

testing 'Hotfixes - 2006-Mar-20' against 'Hotfixes - 2006-Mar-20'

testing 'General - 2006-Mar-20' against 'Applications - 2006-Mar-20'

testing 'Hotfixes - 2006-Mar-20' against 'Applications - 2006-Mar-20'

testing 'Applications - 2006-Mar-20' against 'Applications - 2006-Mar-20'

Use of uninitialized value in pattern match (m//) at compinfo.pl line 197.
retrying default method at /PerlApp/Win32/OLE/Lite.pm line 156.
Win32::OLE(0.1403) error 0x8001010a: "The message filter indicated that the
application is busy"
    in METHOD/PROPERTYGET "" at compinfo.pl line 320
e:\lab reports\test45>


Investigate and solve the 'uninitialized variable' message from
perl first, or all bets are off on why Excel is reporting busy..

197:     $ncell = $ws1 -> Range("A$row") -> {'Value'};
i think 156 and 320 are ole.

code and such again: http://rapidshare.de/files/16004488/compinfo.zip.html

Mr. Raven, i'll send the zip directly to you since you cant get it. I know that actrive state scrubs it.

Thanx in advance for the help.

-Josh

-----------------------------------------
PLEASE NOTE: SeaChange International headquarters in Maynard, MA is moving!
Effective March 1, 2006, our new headquarters address will be:

SeaChange International 50 Nagog Park Acton, MA 01720 USA All telephone numbers remain the same: Main Corporate Telephone: 978-897-0100 Customer Service Telephone: 978-897-7300

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

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

Reply via email to