in reply to Re: Re: Re: Problem with Excel and Win32::OLE
in thread Problem with Excel and Win32::OLE

Thanks for the help,

I managed to solve the problem:
$newworksheet->Activate(); $Excel->ActiveWindow->{DisplayGridlines} = 'False';


But now I have an other problem... I searched in the object browser, but I din't manage to solve the problem.
In a chart I would like to set the font size to 8... I recorded the following macro and I tried to set them to 8 but the fonts still 8 and no error message comes up.
The VB macro
Selection.TickLabels.AutoScaleFont = False With Selection.TickLabels.Font .Name = "Arial" .FontStyle = "Standard" .Size = 8 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic .Background = xlAutomatic End With

Because only the Size is needed I tried to convert it into the following perl code:
$Excel->Selection->ThickLabels({AutoScaleFont => 0}); $Excel->Selection->ThickLabels({Font => {Size => 8}});

No error message and no size of 8, can anybody help me?
Thanks a lot

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Problem with Excel and Win32::OLE
by bmann (Priest) on May 07, 2004 at 15:19 UTC
    Selection.TickLabels.AutoScaleFont = False $Excel->Selection->ThickLabels({AutoScaleFont => 0});

    The first line is from the VBA code, the second is perl. See the extra 'h'?

      D'oh,
      and I searched hours for a solution...

      But the code:
      $Chart -> Axes(xlCategory) -> Select; $Excel->Selection->TickLabels({Font => {Size => 8}});

      Still won't function, it should resize the Font of the xlCategory in a chart to 8, but it still remains at the default size of 10... I tried several versions, but still won't function...

      Thanks for help...
        TickLabels is not a function, so don't use it like one.

        $Excel->Selection->TickLabels({Font => {Size => 8}});
        Should be (Untested!)
        $Excel->Selection->TickLabels->Font->{Size} = 8;

        This stuff is fundamental to using OLE from perl. You need to read the Win32::OLE docs as well as Excel's help file to help you understand how to translate from VB to perl.