in reply to Another Excel/OLE question.

"xlCenter"

xlCenter is not a string in the VB code, so it should not be a string in the perl code. It is supposed to be a constant. See Re: Setting Terminal Server User Profile Settings

Replies are listed 'Best First'.
Re^2: Another Excel/OLE question.
by Morellio (Initiate) on Jun 03, 2011 at 17:36 UTC

    Thanks for the response and input! I had actually tried passing the value as a string and a constant with the same result. I wasn't actually sure it mattered, because no errors are thrown and if I set Merge to "True", it had the same effect as the constant True. To add a bit more detail, I am merging a bunch of cells and trying to add the title of an Excel spread sheet, and center it. Here's the nitty gritty:

    #Insert logo and title $sheet -> Range("1:1") -> {RowHeight} = 60; $sheet -> Range("F1:S1") -> Font -> {Name} = "Arial Rounded MT B +old"; $sheet -> Range("F1:S1") -> Font -> {Size} = 36; $sheet -> Range("F1:S1") -> Font -> {Bold} = True; $sheet -> Range("F1:S1") -> {MergeCells} = True; $sheet -> Range("F1:S1") -> {HorizontalAlignment} = xlCenter; $sheet -> Range("F1:S1") -> {VerticalAlignment} = xlCenter; $sheet -> Range("F1:S1") -> {Value} = "Great Job!";
      I had actually tried passing the value as a string and a constant with the same result.

      Did you declare/define the constant?

        I looked into OLE constants and found some disparity that ended up fixing my problem. Some guides online had me using the second example below instead of the first. Googling perl ole excel constants led me to this page which had a better example.