以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  删除excel图片  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=172364)

--  作者:lxhmax
--  发布时间:2021/10/9 10:24:00
--  删除excel图片
可以用代码删除excel里面的图片吗?
--  作者:有点蓝
--  发布时间:2021/10/9 10:40:00
--  
Dim app As New MSExcel.Application
try
    Dim fileName = "e:\\123.xls"
    Dim doc As object = App.WorkBooks.Open(fileName)
    Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
    For Each a As object In ws.Shapes
        a.delete
    Next
    
    app.visible = True
catch ex As exception
    msgbox(ex.message)
    app.Quit
End try