Charts in VBA

Joined
Jul 26, 2011
Messages
9
Reaction score
0
Hi I have a chart in excel and I want the chart to be displayed into a user form, Im not quite sure where Im going wrong, any help would be greatfull. Below is my code to output the chart.


Private Sub CommandButton1_Click()
Dim FilePathNameOfChart As String, CurrentChart As Object

Set CurrentChart = Sheets(1).ChartObjects(1).Chart

FilePathNameOfChart = Lecture_10 & "\Chart1.gif"

CurrentChart.Export FileName:=FilePathNameOfChart, FilterName:="GIF"

Image1.Picture = LoadPicture(FilePathNameOfChart)



End Sub



Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top