office交流網(wǎng)--QQ交流群號及微信交流群

Access培訓(xùn)群:792054000         Excel免費(fèi)交流群群:686050929          Outlook交流群:221378704    

Word交流群:218156588             PPT交流群:324131555

微信交流群(請用微信掃碼)

        

導(dǎo)出Excel工作表中所有形狀為圖片,要經(jīng)過ChartObjects的轉(zhuǎn)換

2021-01-29 08:00:00
zstmtony
原創(chuàng)
3320

導(dǎo)出Excel工作表中所有形狀為圖片,要經(jīng)過ChartObjects的轉(zhuǎn)換。相關(guān)的代碼如下


Dim shp As Shape


For Each shp In ActiveSheet.Shapes
        shp.CopyPicture
        ActiveSheet.Paste
            With ActiveSheet.ChartObjects.Add(0, 0, shp.Width, shp.Height).Chart
                .Paste
                .Export "D:\Export" & shp.Name & ".jpg", "JPG"
                Selection.Delete
                .Parent.Delete
            End With

Next
分享
文章分類
聯(lián)系我們
聯(lián)系人: 王先生
Email: 18449932@qq.com
QQ: 18449932
微博: officecn01
移動訪問