Hi. I received your email. I am out of the office from Friday, August
25, 2006 through Friday, September 15, 2006. I will respond to emails
and voicemails when I return. If you need assistance before then, please
contact Janice Albert. 

Thank you,

Steve


>>> perl-win32-users 08/25/06 12:00 >>>

Send Perl-Win32-Users mailing list submissions to
        perl-win32-users@listserv.ActiveState.com

To subscribe or unsubscribe via the World Wide Web, visit
        http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Perl-Win32-Users digest..."


Today's Topics:

   1. Re: [OLE] Excel - problem creating multiple charts
      (Lyndon Rickards)


----------------------------------------------------------------------

Message: 1
Date: Thu, 24 Aug 2006 20:25:16 -0400
From: Lyndon Rickards <[EMAIL PROTECTED]>
Subject: Re: [OLE] Excel - problem creating multiple charts
To: rob johnson <[EMAIL PROTECTED]>
Cc: perl-win32-users@listserv.activestate.com
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

rob johnson wrote:
> Hi
>
> I am having a difficult time getting Excel automation to work
> correctly.    specifically, i've become hung up on creating multiple
> charts.
>
> I am able to make a basic XY Scatter plot with the following code:
>
> ==================================
> $Sheet->Range("A:A,D:D,K:K,R:R")->Select;
> $Chart = $Book->Charts->Add;
> $Chart->{ChartType} = xlXYScatter;
> $Chart->{Name}="Temperature";
> ==================================
>
> and it correctly charts D, K, and R column data (temperatures) versus
> the A column data (time)
>
> but if i want to make another (separate) chart plotting E, L, and S
> column data (conductivity) versus the A column data (time), and i
> follow the above code with a similar block:
>
> ==================================
> $Sheet->Range("A:A,E:E,L:L,S:S")->Select;
> $Chart = $Book->Charts->Add;
> $Chart->{ChartType} = xlXYScatter;
> $Chart->{Name}="Conductivity";
> ==================================
>
> it fails, with the following error message
>
> ====================================================
> OLE exception from "Microsoft Excel":
>
> Unable to get the Select property of the Range class
>
> Win32::OLE(0.1704) error 0x800a03ec
>     in METHOD/PROPERTYGET "Select" at hexconvert.pl line 322
> ====================================================
>
> (where line 322 is in the second block:
> $Sheet->Range("A:A,E:E,L:L,S:S")->Select; )
>
> Can someone point out where I'm going wrong?
>
> Also, If I could just find a reference of Excel OLE properties and
> methods I think I could hack my way through it.  But I haven't been
> able to find anything like that.
>
> does anyone know if such a list exists?
>
> thanks, 
> rob
>
>   
I know I've faced this in the past after converting recorded macro 
verbatim. I can't easily test a
solution based on your example because it is not 'complete and 
working'... ;-) A couple of things
that might help:

A snippet of mine that sets a range as source for a chart:

$range = "A25:" . $endCol . "26";
$Excel->ActiveSheet->ChartObjects('Chart 1')->Activate();
$Excel->ActiveChart->SetSourceData({Source => $pSheet->Range($range), 
PlotBy => 2});

As I recall, it is possible to skip the ...Activate line and reference 
the ChartObjects(...) instead
of ActiveChart in the line following it.

The VBA editor itself has the Object Browser documentation built-in - 
right-click in editor pane.

Often, pasting the error right into Google yields valuable pointers or 
solutions.

Even though I use perl almost exclusively over VBA I have had excellent 
method advice from contributors
over on microsoft.public.excel.misc.

HTH - Lynn.



------------------------------

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


End of Perl-Win32-Users Digest, Vol 1, Issue 1798
*************************************************

CONFIDENTIALITY NOTICE: This communication with its contents may contain
confidential and/or legally privileged information. It is solely for the
use of the intended recipient(s). Unauthorized interception, review, use
or disclosure is prohibited and may violate applicable laws including
the Electronic Communications Privacy Act. If you are not the intended
recipient, please contact the sender and destroy all copies of the
communication.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to