Sub Main Dim GrapherApp As Object Set GrapherApp = CreateObject("Grapher.Application") GrapherApp.Visible = True 'Add a plot document Set Plot = GrapherApp.Documents.Add(grfPlotDoc) 'Add a graph Set Graph = Plot.Shapes.AddLinePlotGraph(GrapherApp.Path+"\samples\sample3.dat") 'Add a fit curve to the first curve Set FitWtgAvg = Graph.Plots(1).AddFit(grfWeightedAvgFit) 'Select Fit curve -- Must be the only item selected to use the next SendKeys commands FitWtgAvg.selected = True 'Use Send Keys to choose Edit | Properties to open Fit curve dialog AppActivate "Grapher" 'SendKeys "{DoubleClickLeft x,y}" SendKeys "%E" SendKeys "o" 'Change Window Width to 3 SendKeys "3" 'Tab to Weights button and press Enter SendKeys "{Tab}" SendKeys"{Enter}" 'The Weights dialog is open. Go to first entry, tab to Set Weight button and press Enter SendKeys "{Down}" SendKeys "{Tab}" SendKeys "{Enter}" 'Set the weight for the first item using SendKeys SendKeys "5" SendKeys "{Enter}" 'Go to the second entry, tab to Set Weight button and press Enter SendKeys"+{Tab}" '+ indicates Shift is pressed SendKeys "{Down}" SendKeys"{Tab}" SendKeys "{Enter}" 'Set the weight for the second item using SendKeys SendKeys "2" SendKeys "{Enter}" 'Go to the third entry, tab to Set Weight button and press Enter SendKeys"+{Tab}" '+ indicates Shift is pressed SendKeys "{Down}" SendKeys"{Tab}" SendKeys "{Enter}" 'Set the weight for the third item using SendKeys SendKeys "3" SendKeys "{Enter}" 'Close dialog SendKeys"{Tab}" SendKeys"{Enter}" Wait 1 'Close dialog SendKeys"{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}" SendKeys"{Enter}" End Sub