I am trying to display an existing graph (Name: Chart 3) from Sheet3 to userform.
I used the below code, and it pops up error with debugging
Private Sub CommandButton1_Click()
Dim cchart As Chart
Dim fname As String
Set cchart = Sheets("Sheet3").ChartObjects("Chart 3").Chart
fname = "C:\CBS Academic\Integrated Strategy Project\Final
Paper\Temp\temp.gif"
cchart.Export Filename:=fname, filtername:="gif"
Image1.Picture = LoadPicture(fname)
End sub
fname(particularlyfnamein the code produced it is broken into 2 lines with out necessary" & _), i think it will work OK. Tried code with modified sheet and chart name andfname. found working without any error .