Re: Formatting Chart to Fit Image Box
hi,
no good - it still doesn't fit.
This is the vba code i use to create and insert the graph, if that helps.
I changed the image-box to stretch mode on the user form itself, but no dice.
Thanks,
John
[vba]Private Sub CommandButton2_Click()
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("Sheet11").Range("A1:J11"), PlotBy _
:=xlRows
ActiveChart.Location Where:=xlLocationAsNewSheet
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Ge for Selected Thickness"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Equations"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Ge Value"
End With
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = True
.HasAxis(xlValue, xlPrimary) = True
End With
ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
ActiveChart.HasDataTable = False
Fname = ThisWorkbook.Path & "\" & ActiveChart.Name & ".gif"
ActiveChart.Export Filename:=Fname, FilterName:="GIF"
Image1.Picture = LoadPicture(Fname)
End Sub[/vba]