CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2011
    Posts
    14

    Question how to change the chart axis of excel automation by MFC

    Dear Gurus,

    I use MFC to automate excel to plot charts. I want to change the axis range of the chart.
    Do you know how I can do that?
    Thank you in advance!

    Jing

  2. #2
    Join Date
    Apr 2002
    Location
    Michigan, USA
    Posts
    869

    Re: how to change the chart axis of excel automation by MFC

    One again I take this from a very old program. It will be similar but the
    exact method names have probably changed.

    Code:
    Axis axx, ayy;
    axx = chart.Axes(COleVariant((short)1), 1);
    axx.SetMaximumScaleIsAuto(FALSE)
    axx.SetHasMajorGridlines(FALSE);
    axx.SetMaximumScale(20.0);
    axx.SetMinimumScale(0.0);
    ayy = chart.Axes(COleVariant((short)2), 1);
    
    ...etc....
    Verere testudinem! (Fear the turtle)

    Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein

    Robots are trying to steal my luggage.

  3. #3
    Join Date
    Mar 2011
    Posts
    14

    Thumbs up Re: how to change the chart axis of excel automation by MFC

    Dear Tom,

    Thank you so much!
    They change a little bit, but essentially it is the same thing. I browed the msdn library, unfortunately cannot figure out the parameter in the Axes method.
    Thank you again! You are such a life saver!

    Jing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured