Home > Excel VBA | GraphControl > Excel グラフを画像(GIF)データとして指定フォルダに作成&保存する(Create graph's image to folder)

Excel グラフを画像(GIF)データとして指定フォルダに作成&保存する(Create graph's image to folder)


エクセルのシート上のグラフをGIF画像として保存するソースコードを紹介します。

This procedure will create GIF image of chart to selected folder.





下記のサンプルコードは、エクセルファイルのあるフォルダ内にシート上の一番若いグラフ(ChartObjects(1))を保存します。グラフ画像の名前は、グラフタイトルに設定しています。もしタイトルがない場合は、プログラムをイグジットして終了します。Chart クラスの "Export" メソッドを使用しています。他にも方法はあると思いますが、"Export" メソッドを使うのが一番手っ取り早い方法です。

The following sample code creates and saves ChartObjects (1) to a folder which is same path with current Excel file. The name of a graph image is set as a graph title. If no title, then program will exit. This code uses "Export" method of "Chart" Class.

GraphControl で使用しているコードです。

This source code is used in GraphControl.

Comments:0

Comment Form

Home > Excel VBA | GraphControl > Excel グラフを画像(GIF)データとして指定フォルダに作成&保存する(Create graph's image to folder)

Return to page top