in reply to Perl (WIN32::OLE) Excel help -- Chart Axis Scaling

I don't know the exact solution for your problem, but if you know how to do it in Excel, Use The Macro Recorder, Luke (Re: Using Win32::OLE and Excel - Tips and Tricks) might describe an approach that guides you to a solution.

  • Comment on Re: Perl (WIN32::OLE) Excel help -- Chart Axis Scaling

Replies are listed 'Best First'.
Re^2: Perl (WIN32::OLE) Excel help -- Chart Axis Scaling
by perl_learner211 (Initiate) on Apr 21, 2009 at 16:12 UTC
    Hi, when I did a Macro. I saw the codes generated
    ...Axes.TickLabelSpacing = 1;

    Then I do the following in perl:

    ...$Xaxes->{TickLabelSpacing} = 1;

    And it said there was an error, so I did the following:

    ...$Xaxes->{TickLabelSpacing}->{Value} = 1;

    error:
    OLE exception from "Microsoft Office Excel":
    Unable to get the TickLabelSpacing property of the Axis class
    Win32::OLE(0.1709) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "TickLabelSpacing" at ...

    And I saw it on
    http://msdn.microsoft.com/en-us/library/aa218119(office.10).aspx

    ChartSpace1.Charts(0).Axes(1).TickLabelSpacing = 2

    I'm not sure where to go from here.
      And it said there was an error,

      What</ error, and who said there was one?

      If the documentation says that TickLabelSpacing is a property, then you can also try

      ->LetProperty('TickLabelSpacing', $OtherObject);

      (as the Win32::OLE documentation says), or a SetProperty call to do what you want.

        I just realized I picked the wrong chart type to begin with.

        I should've picked 'xlLineMarkers' instead of the XYScatterplot.

        Anyways, thanks for all the help. :-)