Sub Main 'Declares GrapherApp as an object Dim GrapherApp As Object 'Creates an instance of the Grapher Application object 'and assigns it to the variable named "GrapherApp" Set GrapherApp = CreateObject("Grapher.Application") 'Makes Grapher visible GrapherApp.Visible = True 'Declares Plot as an object Dim Plot As Object 'Creates a plot document in Grapher and 'assigns it to the variable named "Plot" Set Plot = GrapherApp.Documents.Add(grfPlotDoc) 'Declares Graph as an object Dim Graph As Object 'Creates a graph and assigns it to the 'variable named "Graph" Set Graph = Plot.Shapes.AddLinePlotGraph(GrapherApp.Path+"\samples\sample3.dat") 'Declare LinePlot as an object Dim LinePlot As Object 'Set LinePlot to the first line plot on the "Graph" graph Set LinePlot = Graph.Plots.Item(1) 'Add bar charts from columns A/C and A/D Graph.AddBarChart(GrapherApp.Path+"\samples\sample3.dat",1,3) Graph.AddBarChart(GrapherApp.Path+"\samples\sample3.dat",1,4) 'Export to JPG Plot.Export(GrapherApp.Path+"\samples\sample3.jpg") End Sub