VBA: 复制单元格,粘贴为图片,然后另存为图片?

VBA: Copy cells, paste as a picture, then save as a picture?

我有以下代码:

Range("A1:M28").CopyPicture Appearance:=xlScreen, Format:=xlPicture

Sheets.Add.Name = "Without Formatting"
Worksheets("Without Formatting").Paste _
Destination:=Worksheets("Without Formatting").Range("A1:M28")

复制一些单元格然后将它们作为图片粘贴到另一个工作表中,有没有办法将图片(最好是 jpeg)保存到特定位置,以便我可以在电子邮件中使用图片?

我过去使用过以下内容。它将单元格复制为图像,创建新图表,将图像粘贴到图表中,将图表导出为图像,然后删除图表。

Range("A1:M28").CopyPicture Appearance:=xlScreen, Format:=xlPicture
    Set cht = ActiveSheet.ChartObjects.Add(0, 0, Rng.Width + 0.01, Rng.Height + 0.01)
    cht.Name = "tempchart"
    cht.Chart.Paste
    ActiveChart.Shapes.Range(Array("chart")).Select
        Selection.ShapeRange.Fill.Visible = msoFalse
        Selection.ShapeRange.Line.Visible = msoFalse
    ActiveSheet.ChartObjects("tempchart").Activate
        ActiveSheet.Shapes("tempchart").Fill.Visible = msoFalse
        ActiveSheet.Shapes("tempchart").Line.Visible = msoFalse
    cht.Chart.Export strPath & "c:\filepath\imagename.jpg"
    ActiveSheet.ChartObjects.Delete

希望这会有所帮助,