|
楼主 |
发表于 2012-2-6 21:17
|
显示全部楼层
本帖最后由 EJR 于 2012-2-6 21:19 编辑
Sub 从Excel工作表导出图片1()
Dim Shp As Shape
Dim FileName As String
For Each Shp In Sheet1.Shapes
If Shp.Type = msoPicture Then
FileName = ThisWorkbook.Path & "\" & Shp.Name & ".gif"
Shp.Copy
Set chrobj = Sheet1.ChartObjects.Add(0, 0, Shp.Width, Shp.Height) '注意度量单位
'ActiveSheet.ChartObjects("图表 5").Activate
chrobj.Select
With Selection.Border
.Weight = 1
.LineStyle = 0
End With
With chrobj.Chart
.Paste
.Export FileName, "gif"
.Parent.Delete
End With
End If
Next
End Sub
我这样加上了录制的代码,能运行。但问题依旧!请朋友帮忙!
|
|