Sub Main 'Declare the variable that will reference the Application Dim SurferApp As Object Set SurferApp = CreateObject("Surfer.Application") SurferApp.Visible = True 'Declares Plot as an object Dim Plot As Object Set Plot = SurferApp.Documents.Add 'Define the input and output files InGrid = SurferApp.Path + "\samples\demogrid.grd" BlankFile = SurferApp.Path + "\samples\demorect.bln" BlankedGrid = SurferApp.Path + "\samples\demoblanked.grd" 'Blanks the grid file using a BLN file SurferApp.GridBlank (InGrid:=InGrid, BlankFile:=BlankFile, Outgrid:=BlankedGrid) 'Declares MapFrame as Object Dim MapFrame As Object 'Creates a contour map and assigns the map frame to the variable "MapFrame" Set MapFrame = Plot.Shapes.AddContourMap(GridFileName:=BlankedGrid) End Sub