[xpost][/xpost]
Hello I am using this code to save the worksheet range as the png file..... I am usually able to generate up to 50 images (or 35) 0 doing loop through the data - but then it just gives the above error - VBA Error 1004 - CopyPicture method of Range class failed
Code
Option Explicit
Sub biy_comara()
Dim spath As String
Dim rrng As Object, sht As Object
Set sht = ThisWorkbook.Worksheets("chart")
spath = ThisWorkbook.Path & "\" & sht.Range("ao1").Value & ".png"
Set rrng = ActiveSheet.Range("A2:aj102")
rrng.CopyPicture appearance:=xlScreen, Format:=xlPicture
With rrng.Parent.ChartObjects.Add(30, 30, 400, 400)
.ShapeRange.Line.Visible = msoFalse
.Height = rrng.Height
.Width = rrng.Width
.Chart.Paste
.Chart.export Filename:=spath, filtername:="png"
.Delete
End With
End Sub
Display More
I wonder if anyone can help me with this? thanks a lot!)