tagCANDY CGI VBレスキュー(花ちゃん) の Visual Basic 2010 用 掲示板(VB.NET 掲示板)
VBレスキュー(花ちゃん) の Visual Basic 2010 用 掲示板(VB.NET 掲示板)
[ツリー表示へ]  [ワード検索]  [Home]

タイトル Re^7: Excelの『既存』グラフをクリップボード経由でPictureBoxに貼付
投稿日: 2010/11/12(Fri) 14:34
投稿者花ちゃん
下記の部分を

>         xlApp.Visible = False
>         Dim MyCharts As Excel.ChartObjects
>         Dim MyChart As Excel.ChartObject
>         Dim MyChart1 As Excel.Chart
>
>         MyCharts = xlSheet.ChartObjects
>         MyChart = CType(MyCharts.Item("Graph1"), Excel.Chart) '-----@
>         MyChart1 = MyChart.Chart


下記のように変更してみて下さい。

        xlApp.Visible = False
        'Dim MyCharts As Excel.ChartObjects
        'Dim MyChart As Excel.ChartObject
        Dim MyChart1 As Excel.Chart

        'MyCharts = xlSheet.ChartObjects
        'MyChart = CType(MyCharts.Item("Graph1"), Excel.Chart) '-----@
        MyChart1 = CType(xlBook.Charts("Graph1"), Excel.Chart)



        MRComObject(MyChart1)           'MyChart1  の解放
        'MRComObject(MyChart)            'MyChart   の解放
        'MRComObject(MyCharts)           'MyChart1s の解放

- 関連一覧ツリー をクリックするとツリー全体を一括表示します)

古いスレッドにレスはつけられません。