标题:如何从EXCEL表上的照片保存为图片文件
只看楼主
mywisdom88
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:190
帖 子:3125
专家分:8340
注 册:2015-3-25
得分:0 
以下是引用吹水佬在2017-6-14 22:39:05的发言:

** 导出EXCEL图片
cPath = "C:\TEMP\"
cXLS = cPath + "test.xls"
oExcel = CREATEOBJECT("Excel.Application")
oExcel.WorkBooks.Open(cXLS)
FOR EACH oShape IN oExcel.ActiveSheet.Shapes
    cJPG = cPath + JUSTSTEM(cXLS) + "_" + STRTRAN(oShape.TopLeftCell.Address,"$","") + ".jpg"
    ? "导出:" + cJPG
    oShape.CopyPicture
    oChart = oExcel.ActiveSheet.ChartObjects.Add(0,0,oShape.Width,oShape.Height).Chart
    oChart.Paste
    oChart.Export(cJPG, "JPG")
    oChart.Parent.Delete
ENDFOR
? "导出完毕"
oExcel.ActiveWorkBook.Saved = .T.
oExcel.WorkBooks.Close
oExcel.Quit

Excel 2013测试通过
2017-06-15 09:25
说不得1199
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2019-11-27
得分:0 
能否把表发我一份,谢谢!!!lj1199@
2019-11-27 09:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-477910-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.362925 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved