Results 1 to 4 of 4

Chart in userform

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-08-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    152

    Chart in userform

    Hi Guys,

    I'm trying to display the chart in userform using the code below which i found on net, but getting an error on red line below stating that the variable not set, any ideas why it is happening?

    Any thoughts are welcome, thanks in advance.

    Private Sub UserForm_Initialize()
    Dim ChartNum As Integer
      ChartNum = 1
        UpdateChart
    End sub
    Private Sub UpdateChart()
    Dim ChartNum As Integer
        Set CurrentChart = Sheets("Data Collection").ChartObjects(ChartNum).Chart
        CurrentChart.Parent.Width = 300
        CurrentChart.Parent.Height = 150
    
    '   Save chart as GIF
        Fname = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
        CurrentChart.Export Filename:=Fname, FilterName:="GIF"
    
    '   Show the chart
        Image1.Picture = LoadPicture(Fname)
    End Sub
    Last edited by intex; 03-29-2015 at 05:53 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Chart on a Userform
    By shiftyspina in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-31-2024, 12:15 PM
  2. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-04-2014, 07:11 AM
  3. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-03-2014, 12:28 PM
  4. Chart in Userform
    By BrianAll in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-22-2013, 01:36 PM
  5. Chart on a Userform
    By Rocky McKinley in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-12-2005, 11:05 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1