Power Query Course in Spanish
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: Graphs Question

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Ireland
    Posts
    107
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    OK I have a few graphs on my work sheets. I would like to put them onto some of my forms. Is there any way you can do this in the same way you do with putting the contents of cells onto a userform?
    [Brian]

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-10 06:00, eddd82 wrote:
    OK I have a few graphs on my work sheets. I would like to put them onto some of my forms. Is there any way you can do this in the same way you do with putting the contents of cells onto a userform?
    Brian....one way to do this is;

    1) Save the graphs as (in this case) a gif
    file.
    2) Then load these in as required.

    Code for 1)


    Sub ChartPict_save()
    Dim sFName As String
    Dim Pict As Object
    Dim ch
    Dim i As Integer

    i = 1
    For Each Pict In ActiveSheet.ChartObjects
    Set ch = Pict.Chart
    sFName = ThisWorkbook.Path & Application.PathSeparator & "temp" & i & ".gif"
    ch.Export Filename:=sFName, FilterName:="GIF"
    i = i + 1
    Next
    Set ch = Nothing
    End Sub


    Code 2


    Image1.Picture = LoadPicture("C:testimg1.gif")




    Change as required or repost if unsure

    Kind Regards,
    Ivan F Moala From the City of Sails

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Location
    Ireland
    Posts
    107
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sorry didnt read ure post probarly Code 1 will do what i want i think. Thanks a lot.

    _________________
    [Brian]

    [ This Message was edited by: eddd82 on 2002-05-10 06:52 ]

  4. #4
    Board Regular
    Join Date
    Apr 2002
    Location
    Ireland
    Posts
    107
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Will this code reload the graph and change it to a gif each time. Do you get what im saying?
    [Brian]

  5. #5
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Brian have a look here for other examples

    http://www.bmsltd.co.uk/Excel/Default.htm

    Look @ PastePicture.zip file this maybe
    of use to you.
    Kind Regards,
    Ivan F Moala From the City of Sails

  6. #6
    Board Regular
    Join Date
    Apr 2002
    Location
    Ireland
    Posts
    107
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    That did the job perfect. Thanks for the help.
    [Brian]

  7. #7
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-10 07:04, Ivan F Moala wrote:
    Brian have a look here for other examples

    http://www.bmsltd.co.uk/Excel/Default.htm

    Look @ PastePicture.zip file this maybe
    of use to you.
    Hmmm, sounds familiar. Is it just coincedence that this question has been asked three times in a short time? Must be mad season. (j/k)

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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