Sub Main 'Declare the variable that will reference the application 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") 'Make Grapher visible GrapherApp.Visible = True 'Declare Plot As Object Dim Plot As Object 'Creates a new plot window and assign it to the variable named "Plot" Set Plot = GrapherApp.Documents.Add(grfPlotDoc) 'Add LinePlotGraph Dim Graph1 As Object Set Graph1 = Plot.Shapes.AddLinePlotGraph(GrapherApp.Path + "\samples\sample3.dat") 'Add legend Set Legend = Graph1.AddLegend(True) 'Add second curve Graph1.AddLinePlot(GrapherApp.Path + "\samples\sample3.dat",,3) 'Add entry on legend Legend.AddEntry("Line/Symbol Plot 2") 'Move legend to new spot Legend.Left = 4 Legend.top = 4.5 'Change entry text for first line Legend.EntryName(1, "Curve 1") 'Change entry font for second line Legend.EntryFont(2).face = "Times New Roman" Legend.EntryFont(2).Bold = True Legend.EntryFont(2).color = grfColorGreen Legend.EntryFont(2).Italic = True Legend.EntryFont(2).size = 8 'Show symbols on the curves and set size Graph1.Plots(1).symbolFreq=1 Graph1.Plots(1).symbol.size = 0.4 Graph1.Plots(2).symbolFreq = 2 Graph1.Plots(2).symbol.size = 0.2 'Change the symbol mode and size Legend.EntrySymbolMode (1,grfFixedSize) Legend.EntrySymbolSize (1,0.03) Legend.EntrySymbolMode (2,grfPlotSize) 'Change the number of symbols shown Legend.SymbolCount = 2 'Change the title font properties Legend.TitleFont.face = "Arial" Legend.TitleFont.size = 16 Legend.TitleFont.color = grfColorBlue 'Change the title text Legend.TitleText = "New Legend Title Text" 'Fill the legend Legend.Fill.foreColor = grfColorBlack10 'Change the line width Legend.line.width = 0.03 'Change the frame style Legend.frameStyle = grfRoundedFrame 'Set the legend margin Legend.margin = 0.35 'Return how many legend items are shown Debug.Print Legend.EntryCount 'Delete the second legend item Legend.DeleteEntry(2) ' End Sub