in reply to Win32::OLE Excell Merge & Center

The value of VBA's xlCenter is not the string 'xlCenter'. You will want to see Win32::OLE::Const for how to extract the xl-constants.

Based on your last example, I think you would need to add

use Win32::OLE::Const; my $xlConstants = Win32::OLE::Const->Load($Excel);
and then change to
$Sheet->Range("B1:Q1")->{HorizontalAlignment} = $xlConstants->{xlCente +r};

(untested: sorry, I don't have Excel on this machine)

Replies are listed 'Best First'.
Re^2: Win32::OLE Excell Merge & Center
by cormanaz (Deacon) on Aug 07, 2023 at 14:57 UTC
    That did it...thanks!