Hi All
I have code to load chart in image in user form.
below is the code
after loading userform, chart looks too small in user form
so i added this line CurrentChart.ChartArea.Width = UserForm1.Image1.Width
when this code is executed, my original chart (in Excel Sheet) got re-sized.
how i can re-size the picture in userform without affecting my original chart.
I have code to load chart in image in user form.
below is the code
VBA Code:
Sub ChangeChart(ChartName As String)
Dim CurrentChart As Chart
Dim Fname As String
Fname = ThisWorkbook.Path & "\temp.gif"
Set CurrentChart = ThisWorkbook.Sheets("Sheet1").ChartObjects(ChartName).Chart
'CurrentChart.ChartArea.Width = UserForm1.Image1.Width
'CurrentChart.ChartArea.Height = UserForm1.Image1.Height
CurrentChart.Export Filename:=Fname, FilterName:="GIF"
UserForm1.Image1.Picture = LoadPicture(Fname)
End Sub
after loading userform, chart looks too small in user form
so i added this line CurrentChart.ChartArea.Width = UserForm1.Image1.Width
when this code is executed, my original chart (in Excel Sheet) got re-sized.
how i can re-size the picture in userform without affecting my original chart.