Copying Multiple Charts as a Picture in Excel 2007 gives Application-defined error

后端 未结 1 406
半阙折子戏
半阙折子戏 2021-01-19 14:08

Introduction

I can\'t seem to get the the ChartObjects.CopyPicture method to work in Excel 2007. No matter what I try I get an error.

Using

相关标签:
1条回答
  • 2021-01-19 14:35

    This issue has been driving me crazy for a long time. I finally found a solution that works, hopefully this will help someone else in the future.

    Basically the solution was to Group the Charts as a single Shape object, then CopyPicture on that shape, then Ungroup when your finished.

    With ActiveSheet.ChartObjects.ShapeRange.Group
        .CopyPicture Appearance:=xlScreen, Format:=xlPicture
        .Ungroup
    End With
    
    Sheets("Sheet2").Paste
    
    0 讨论(0)
提交回复
热议问题