Sub Main 'Declare the variable that will reference the application Dim SurferApp As Object Set SurferApp = CreateObject("Surfer.Application") 'Chooses not to make the Surfer application visible SurferApp.Visible = False 'Declares Plot as an object Dim Plot As Object Set Plot = SurferApp.Documents.Add 'Defines the grid file to convert GridFile = SurferApp.Path+"\Samples\demogrid.grd" 'Defines where to save the DAT file to OutFile = SurferApp.Path+"\Samples\dgrid1" 'Convert the grid file to an ASCII XYZ DAT SurferApp.GridConvert(InGrid:=GridFile, OutGrid:=OutFile, OutFmt:=srfGridFmtXYZ) 'Quits Surfer SurferApp.Quit End Sub