我有以下代码:
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
希望这会有所帮助,
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句