Yes that was it, Thanks a lot...

Here comes my next Problem: the VB Code is sthe following:

Set RangeofChard = Union(Range(Cells(ChardRowStart, 1), Cells(ChardRow +End, 1)), _ Range(Cells(ChardRowStart, UsedCol), Cells(Ch +ardRowEnd, UsedCol)), _ Range(Cells(ChardRowStart, MaintCol), Cells(C +hardRowEnd, MaintCol)), _ Range(Cells(ChardRowStart, OtherUsedCol), Cel +ls(ChardRowEnd, OtherUsedCol)))

This had created a Range for a chart, the range looked like this: "A2:A4,B2:B4, E2:E4 ..."

Now Ive tried to convert it to perl code: but there are always Errorcodes, the problem is, that i cannot simply put it into an string because the Column indixes are numeric like 1,2,3... but for the range they must be converted to "A,B,C..." but I dont know how to make this?

If i simply try this for example:

my $Range = $currentsheet->Union($currentsheet->Range($currentsheet->C +ells($HeaderRow, 1), $currentsheet->Cells($ToIndex, 1)), $currentsheet->Range($currentsheet->Cells($He +aderRow, $UsedCol), $currentsheet->Cells($ToIndex, $UsedCol)), $currentsheet->Range($currentsheet->Cells($He +aderRow, $MaintCol), $currentsheet->Cells($ToIndex, $MaintCol)), $currentsheet->Range($currentsheet->Cells($He +aderRow, $OtherUsedCol), $currentsheet->Cells($ToIndex, $OtherUsedCol +))); print "$Range\n";
Then Range is empty...

I think this will be the last problem, because ist is at the end of my macro...

Thanks for help

UPDATE: I dont know why but all my line breaks are gone

Edited by Chady -- fixed formatting, added code tags.


In reply to Re: Re: Re: Re: Re: Re: Question about Win32::OLE and Excel by Streen
in thread Question about Win32::OLE and Excel by Streen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.