ขึ้น Run-Time Error 1004 Run time Error 1004 copy picture method of range class failed ครับ
Posted: Mon Jun 18, 2018 2:49 pm
มันโชว์ Run time Error 1004 copy picture method of range class failed เวลาผม Export Range to JPG ครับ
Sub AREA()
Worksheets("AREA").Activate
'ActiveWindow.Zoom = 300
LocationFile = Sheets("LocationFile").Range("A10")
Name_Range = Range("AREA").Select
With Selection
[font].CopyPicture Appearance:=xlScreen, Format:=xlPicture[/font] <<<<< บรรทัดนี่ครับ
With ActiveSheet.ChartObjects.Add(Left:=.Left, Top:=.Top, Width:=.Width, Height:=.Height)
.Name = "TempChart"
.Activate
End With
End With
ActiveChart.Paste
With ActiveSheet.ChartObjects("TempChart")
.Chart.Export LocationFile
.Delete
ActiveWindow.Zoom = 80
End With
End Sub
Sub AREA()
Worksheets("AREA").Activate
'ActiveWindow.Zoom = 300
LocationFile = Sheets("LocationFile").Range("A10")
Name_Range = Range("AREA").Select
With Selection
[font].CopyPicture Appearance:=xlScreen, Format:=xlPicture[/font] <<<<< บรรทัดนี่ครับ
With ActiveSheet.ChartObjects.Add(Left:=.Left, Top:=.Top, Width:=.Width, Height:=.Height)
.Name = "TempChart"
.Activate
End With
End With
ActiveChart.Paste
With ActiveSheet.ChartObjects("TempChart")
.Chart.Export LocationFile
.Delete
ActiveWindow.Zoom = 80
End With
End Sub