I would like to have a graph to pulled on to a userform for display purpose.
I would like to hava a VBA macro to do this operation for a command click event.
Thanks a lot for your valuable time!
Taniks
I would like to have a graph to pulled on to a userform for display purpose.
I would like to hava a VBA macro to do this operation for a command click event.
Thanks a lot for your valuable time!
Taniks
See John Walkenbach's tip
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
For some odd reason, when I tried that in excel 03, the pasted chart image does not show up unless I literally drag the chart object outside of the visible screen area. When I drag it back, it reappears. Anyone know why this is so?
The example works fine for me in Excel 2003
Stephen Bullen has a method here, towards the bottom "PastePicture"
I named a sheet Charts, and userform1.show from that sheet. Create a Chart on that sheet, add 2 option buttons and 1 image control to the userform.
![]()
Private Sub OptionButton1_Click() UpdateChart 1 End Sub Private Sub OptionButton2_Click() UpdateChart 2 End Sub Private Sub UpdateChart(ChartNum As Integer) Dim currentchart As Chart, Fname As String Set currentchart = Sheets("Charts").ChartObjects(ChartNum).Chart currentchart.Parent.Width = 400 currentchart.Parent.Height = 200 ' 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
Thanks a lot for all your replies!
I will try it out and inform you all !
Thanks a lot for ur time again!
Regards
Taniks
I would like to thank Roy and Kenneth for their solution to my query!
I apologise for my late reply!
Thanks for your time !
Regards
Taniks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks