|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Chart.export导出图片-2010下正常.rar
(63.62 KB, 下载次数: 11)
Sub 导出图片()
Dim Shp As Shape
Dim FileName As String
For Each Shp In ActiveSheet.Shapes
If Shp.Type = msoPicture Then
Shp.Copy
With ActiveSheet.ChartObjects.Add(0, 0, Shp.Width, Shp.Height).Chart
.ChartArea.Border.LineStyle = xlLineStyleNone '0 '去掉边框
.Paste
FileName = ThisWorkbook.Path & "\" & Shp.Name & ".gif"
.Export FileName, "gif"
'.Parent.Delete
End With
ActiveSheet.Shapes.AddPicture FileName, msoTrue, msoCTrue, 300, 50, Shp.Width, Shp.Height
End If
Next
End Sub
经测试在2010下,用export导出图片大小一样,没有变化。如果不加红色语句,会多1个像素。
|
|