vba代码:n=0
for each sh in activesheet.shapes
n=n+1
sh.copy
with activesheet.chartobjects.add(0,0,sh.width,sh.height).chart
.paste
.export thisworkbook.path & "\pic-" & n & ".jpg","jpg"
.delete
end with
next sh
转换成au3代码如下:$excel=ObjCreate("excel.application")
$excel.visible=True
$wb=$excel.workbooks.open(@ScriptDir&"\pic.xls")
$n=0
For $sh In $wb.activesheet.shapes
$n+=1
$sh.copy
$chart=$wb.activesheet.chartobjects.add(0,0,$sh.width,$sh.height)
$chart.chart.paste
$chart.chart.export(@ScriptDir&"\Pic-"&$n&".jpg","jpg")
$chart.delete
Next
$wb.close(false)
$excel.quit
楼主测试一下 |