First post here, let me know if I should be doing anything differently. Have had some success first getting into Excel/OLE and have learned through this site how to use macros to determine what tags to use. Thanks! One of the tags for setting vertical and horizontal alignment (to center text) does not appear to be having any effect despite all of the permutations I've tried. In some guides online I've seen examples like:

$sheet -> Range("G7:H7") -> {HorizontalAlignment} = xlHAlignCenter; + # Center text;

However by making/editing a macro after manually centering the text I see the equivalent of the following:

$sheet -> Range("F1:S1") -> {HorizontalAlignment} = "xlCenter"; $sheet -> Range("F1:S1") -> {VerticalAlignment} = "xlCenter";

Both seem to be recognized tags and don't toss errors, but none actually modify the format of those cells. They remain the default xlGeneral, xlBottom after the code runs. Here is the macro output I'm looking at pushing into OLE code.

Range("A1:S1").Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = True End With

In reply to Another Excel/OLE question. by Morellio

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.