首页 > Excel专区 > Excel函数 >

EXCEL 实现批量导出图片

Excel函数 2022-02-16 20:59:19

Sub ExportPictures()
Dim MyShp As Shape
Dim Filename As String
For Each MyShp In Sheet1.Shapes
If MyShp.Type = msoPicture Then
Filename = ThisWorkbook.Path & "\" & MyShp.Name & ".gif"
MyShp.Copy
With Sheet1.ChartObjects.Add(0, 0, MyShp.Width, MyShp.Height).Chart
.Paste
.Export Filename
.Parent.Delete
End With
End If
Next
Set MyShp = Nothing
End Sub


标签: 上一篇下一篇另存为导出excel函数

office教程网 Copyright © 2016-2020 http://www.office9.cn. Some Rights Reserved. 苏ICP备20040415号-9