marlonsaveri
Board Regular
- Joined
- Jan 28, 2011
- Messages
- 68
Hi, I have a 1004 error in this code:
("C17:D27,F17:F27,H17:H27,J17:J27"):
C17:C27: axis Y (numbers)
D17:D27; F17:F27; H17:H27 and J17:J27: series (numbers)
When I do just ("C17:D27") it's ok.
Thanks.
Code:
Dim currentchart As Chart
Dim Fname As String
Range("C17:D27,F17:F27,H17:H27,J17:J27").Select
Range("J17").Activate
[COLOR=red]activesheet.Shapes.AddChart.Select[/COLOR]
With ActiveChart
.ChartType = xlXYScatterSmooth
.SetSourceData Source:=Range( _
"Convectiva!$C$17:$D$27;Convectiva!$F$17:$F$27;Convectiva!$H$17:$H$27;Convectiva!$J$17:$J$27" _
)
.Legend.Delete
.ClearToMatchStyle
.ChartStyle = 43
.ClearToMatchStyle
End With
Set currentchart = ActiveChart
Fname = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
currentchart.Export Filename:=Fname, FilterName:="GIF"
Image2.Picture = LoadPicture(Fname)
("C17:D27,F17:F27,H17:H27,J17:J27"):
C17:C27: axis Y (numbers)
D17:D27; F17:F27; H17:H27 and J17:J27: series (numbers)
When I do just ("C17:D27") it's ok.
Thanks.