none
Displaying “live” chart data in Excel Userform RRS feed

  • Question

  • I am trying to put together a Userform which takes relevant data from different Work Sheets and displays it on separate pages of the Userform.

    I am trying to display a live chart on one of these Userform pages but cannot seem to work out how its done.

    The Userform will be open all the time the workbook is open, but moved to a second monitor. The Userform is to be used as a navigation tool to open the relevant Work sheets.

    Page 2 of the Userform (Graph) will display the live graph taken from a graph on "Graph" worksheet.

    Any ideas?

    regards


    Steve

    Monday, March 13, 2017 11:38 AM

Answers

  • Sorted, I had the code in the Sheet and not Userform.

    Private Sub UserForm_Initialize()
        Dim Fname As String
    
        Call SaveChart
        Fname = ThisWorkbook.Path & "\temp1.gif"
        Me.Image1.Picture = LoadPicture(Fname)
    End Sub
    
    Private Sub SaveChart()
        Dim MyChart As Chart
        Dim Fname As String
    
        Set MyChart = Sheets("Graph").ChartObjects(1).Chart
        Fname = ThisWorkbook.Path & "\temp1.gif"
        MyChart.Export Filename:=Fname, FilterName:="GIF"
    End Sub

    • Marked as answer by Steve MW Monday, March 13, 2017 1:23 PM
    • Unmarked as answer by Steve MW Monday, March 20, 2017 12:15 PM
    • Proposed as answer by Chenchen LiModerator Saturday, March 25, 2017 4:32 AM
    • Marked as answer by Steve MW Thursday, March 30, 2017 4:50 PM
    Monday, March 13, 2017 1:23 PM

All replies

  • Sorted, I had the code in the Sheet and not Userform.

    Private Sub UserForm_Initialize()
        Dim Fname As String
    
        Call SaveChart
        Fname = ThisWorkbook.Path & "\temp1.gif"
        Me.Image1.Picture = LoadPicture(Fname)
    End Sub
    
    Private Sub SaveChart()
        Dim MyChart As Chart
        Dim Fname As String
    
        Set MyChart = Sheets("Graph").ChartObjects(1).Chart
        Fname = ThisWorkbook.Path & "\temp1.gif"
        MyChart.Export Filename:=Fname, FilterName:="GIF"
    End Sub

    • Marked as answer by Steve MW Monday, March 13, 2017 1:23 PM
    • Unmarked as answer by Steve MW Monday, March 20, 2017 12:15 PM
    • Proposed as answer by Chenchen LiModerator Saturday, March 25, 2017 4:32 AM
    • Marked as answer by Steve MW Thursday, March 30, 2017 4:50 PM
    Monday, March 13, 2017 1:23 PM
  • Hello,

    It seems that the issue has been resolved, I suggest you mark your post as answer to close the thread. Thanks for your understanding.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 30, 2017 8:13 AM
    Moderator