|
Book4.zip
(415.95 KB, 下载次数: 9)
请求老师帮忙:导出代码出错,
Dim strPath$, nm$, sh As Shape
Dim ch As Chart, i&
Dim cht As ChartObject
Application.ScreenUpdating = False
strPath = ThisWorkbook.Path & "\"
For i = 1 To ActiveSheet.Shapes.Count
Set sh = ActiveSheet.Shapes(i)
nm = Range(sh.TopLeftCell.Address).Offset(0, -1).Value
If nm = "" Then GoTo 100
sh.CopyPicture
Set cht = ActiveSheet.ChartObjects.Add(100, 100, 200, 200)
With cht
.Chart.Paste
.Chart.Shapes(1).Height = 200
.Chart.Shapes(1).Width = 200
.Chart.Export strPath & nm & ".jpg"
.Delete
End With
100:
Next
Application.ScreenUpdating = True
|
|