CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
Win32::OLE chart Generation problem Excel 2007

 



ketanpatel.ec
New User

Apr 9, 2013, 1:24 PM

Post #1 of 1 (2050 views)
Win32::OLE chart Generation problem Excel 2007 Can't Post

Hello All,
I am running following simple script on perl64 to generate chart on excel but I am getting following errors
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 Start =======================
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;
#$Chart->ChartTitle->{Text} = "Items delivered, en route and to be shipped";

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives