'PRINT WITH FILE.BAS 'This script prints multiple graphs using a template graph and a text file 'consisting of data file names. Please see "worksheet inputs.txt" as an 'example text file. The text file must end with EOF. Change the paths below 'to match your data and template graph paths. Sub Main 'Declare Grapher as an object Dim Grapher As Object 'Starts Grapher Set Grapher = CreateObject("Grapher.Application") 'Remove the quote to make Grapher visible 'Grapher.Visible(1) 'Open the text file containing the data paths and file names Open "C:\Program Files\Golden Software\Grapher\Samples\worksheet inputs.txt" For Input As #1 'Input a line from the text file above Line Input #1,wks$ While wks$ <> "EOF" 'Open the template file with one line (data file) from the text file Set doc = Grapher.Documents.Add(0,"C:\Program Files\Golden Software\Grapher\Samples\lineplot.grt",wks$) 'Print the graph doc.Print() 'Close the plot window doc.Close() 'Input the next line in the text file Line Input #1,wks$ Wend Close #1 Grapher.Quit() End Sub