Most valuable professional
  • Hot Topics

Excel Copy range as jpg without creating/deleting chart?

Hi guys, I have adapted this code to my spreadsheet. Code: Private Dim rgExp As Range: Set rgExp = Range("D6:Q27") ''' Copy range as picture onto Clipboard rgExp.CopyPicture Appearance:=xlScreen, Format:=xlBitmap ''' Create an empty chart with exact size of range copied With ActiveSheet.ChartObjects.Add(Left:=rgExp.Left, Top:=rgExp.Top, _ Width:=rgExp.Width, Height:=rgExp.Height) .Name = "Table" .Activate End With ''' Paste into chart area, export to file, delete chart. Application.EnableEvents = False ActiveChart.Paste ActiveSheet.ChartObjects("Table").Chart.Export Filename:=Application.ActiveWorkbook.Path & "\T25(1).jpg", Filtername:="jpg" ActiveSheet.ChartObjects("Table").Delete Application.EnableEvents = True End Sub

This question generated 37 answers. To proceed to the answers, click here.

This thread is current as of January 5, 2014.

For more resources for Microsoft Excel:

This article includes the following tags:

  • Excel
  • Microsoft Excel