发布网友 发布时间:2022-04-29 03:30
共1个回答
热心网友 时间:2023-06-16 12:19
灞曞紑鍏ㄩ儴Sub Demo()
Dim Sht As Worksheet
Dim objCht As ChartObject
Dim Shp As Shape
Dim RngAddress As String, FN As String, PN As String
Set Sht = ActiveWorkbook.ActiveSheet
RngAddress = "A1:G16"
PN = ActiveWorkbook.Path & "\鍥剧墖\"
FN = ActiveSheet.Range("J1") & ".bmp"
With Sht
.Range(RngAddress).CopyPicture Appearance:=xlScreen, Format:=xlBitmap
.Paste
Set Shp = .Shapes(.Shapes.Count)
Set objCht = ActiveSheet.ChartObjects.Add(0, 0, Shp.Width, Shp.Height)
End With
With objCht.Chart
.Parent.Select
.Paste
.Export Path & PN & FN
End With
Shp.Delete
objCht.Delete
End Sub