While I don't have your exact setup, this script works fine in perl 5.8
(32-bit), Excel 2003 (32-bit) on Win Server 2003 (32-bit)..  Yes, it's a
dated config..  But it's running fine for now.

As well, I ran this on Win7 (x64), Perl 5.8 (32-bit), Excel 2010
(32-bit).  it worked fine again.  (Which seems to point to the version
of office not being an issue --  2003 - 2010 should work fine if 2003
and 2010 do.
 
I'd suspect that the Office you have might be 32-bit and you are trying
to use Perl64 which may have issues calling a 32-bit object (64-bit
calls to a 32-bit COM object) although I can't guarantee that ..  I just
know that I run into this particualr problem in VBScript unless I use
the 32-bit VBScript engine in %SYSTEMROOT%\syswow64\cscript.exe when
invoking 32-bit COM objects (like my office apps).

If the script you provided is the exact script you used to generate the
error, it seems as though it's complaining about this line...  Which
somewhat points to charting being a suspect for a 32-bit COM object.
 
Line 20 = $Chart->{ChartType} = xlAreaStacked;

But again, I've ignored the possibility of Perl having an issue as I
don't have v5.16 or perl64 handy to test in your particular config, nor
did you tell us if the Office you have is 64 or 32-bit (which would add
to the troubleshooting of this issue).

FYI and HTH

Steven
________________________________

From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
ketan patel
Sent: Tuesday, April 09, 2013 2:21 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Win32::OLE Module - Excel chart Generation Problem


Hello All,
I am running following simple script on perl64 to generate chart on
excel but I am getting following errors without generating any chart.
It opens excel sheet, write data into sheet but no chart.

Win32::OLE(0.1709) error 0x80020003: "Member not found"
    in PROPERTYPUT "ChartType" at C:\path\test.pl line 20.

Here is my system spec


PERL version : Perl 64 v5.16.3
WIN32 OLE : 0.1709
Excel Version : Excel 2007 SP3

Can anyone please give me some input on how I can remove this error and
generate chart ?

Thank you,
======================Script =======================

use strict;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Excel';

my $Excel = Win32::OLE->new("Excel.Application");
$Excel->{Visible} = 1;
$Win32::OLE::Warn = 3;
my $Book = $Excel->Workbooks->Add;
my $Sheet = $Book->Worksheets(1);
my $Range = $Sheet->Range("A2:C7");
$Range->{Value} =
    [['Delivered', 'En route', 'To be shipped'],
     [504, 102, 86],
     [670, 150, 174],
     [891, 261, 201],
     [1274, 471, 321],
     [1563, 536, 241]];

my $Chart = $Excel->Charts->Add;
$Chart->{ChartType} = xlAreaStacked;
$Chart->SetSourceData({Source => $Range, PlotBy => xlColumns});
$Chart->{HasTitle} = 1;

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to