Consulting

Results 1 to 7 of 7

Thread: Solved: Scale graph absolutely

  1. #1

    Solved: Scale graph absolutely

    Hi all,

    I'm trying to do a part of a macro where i want to resize a graph.
    I do a code that sizes the graph in relative terms, but does anybody know how to do it in absolute terms?
    /Enfant Terrible

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    What do you mean?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Im doing a macro that creates graphs in the right colour - now and want to include a part so they get the right size as well. But i can only figure out a way to change the relative size (eg. make it 50 pct. smaller ) not to change it to absolut size no matter what size the graphs is at the begining.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    This works fine for me

    [vba]

    With ActiveSheet.ChartObjects("Chart 1")

    .Height = 200
    .Width = 300
    End With
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Ok, i guess then it is just me who is thumbling.
    Is it possible to put something like ActiveChart inside the paranthathese?!

  6. #6
    i know that this is probably too simply but i would need to attach something so this applies to the activechart

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It is the chartobject that has height, so you have to get the chart parent

    [vba]

    With ActiveChart.Parent

    .Height = 200
    .Width = 300
    End With
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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