Morellio has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Another Excel/OLE question.
by Anonymous Monk on Jun 03, 2011 at 01:29 UTC | |
by Morellio (Initiate) on Jun 03, 2011 at 17:36 UTC | |
by Anonymous Monk on Jun 03, 2011 at 18:06 UTC | |
by Morellio (Initiate) on Jun 03, 2011 at 22:18 UTC | |
by Anonymous Monk on Jun 03, 2011 at 22:51 UTC |