|
加一句红色的代码试试,我以前也出现过导出来是空白的:手动调试没问题,一次执行就出问题了,最后估计是执行速度太快没跟上,你试试下面的
Sub CC()
Dim st$, shp As Shape
Application.ScreenUpdating = False
Application.DisplayAlerts = False
st = Dir(ThisWorkbook.Path & "\*.xls?")
Do While st <> ""
If st <> ThisWorkbook.Name Then
Workbooks.Open (ThisWorkbook.Path & "\" & st)
For Each shp In Workbooks(2).Sheets("照片和宗地图").Shapes
k = k + 1
shp.Copy
With ChartObjects.Add(0, 0, shp.Width, shp.Height).Chart
.parent.select
.Paste
.Export ThisWorkbook.Path & "\" & Workbooks(2).Sheets("照片和宗地图").Cells(3, 2).Value & "+" & k & ".png"
.Parent.Delete
End With
Next
Workbooks(2).Close
End If
k = 0
st = Dir
Loop
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub |
评分
-
1
查看全部评分
-
|