'#Reference {54C3F9A2-980B-1068-83F9-0000C02A351C}#1.0#0#C:\Program Files\Golden Software\Surfer8\surfer.exe#Surfer 8 Type Library 'GridExtractFromSrf.bas extracts the grid file from a SRF file. ' Select the map, then run the script. ' TB - 11 Nov 03. Sub Main Debug.Print "----- ";Time;" -----" Set surf = GetObject(,"surfer.application") Set plotdoc1 = surf.ActiveDocument Set shapes1 = plotdoc1.Shapes Set mapframe1 = plotdoc1.Selection(1) For Each ovrly In mapframe1.Overlays 'Vector map Not included. srfShapeVectorMap = 23. Debug.Print ovrly.Type;InStr(" 15 16 19 20 22", ovrly.Type) If InStr(" 15 16 19 20 22",ovrly.Type) <> 0 Then ovrly.Grid.SaveFile(GetFilePath(ovrly.Grid.FileName,"grd", _ "c:\incoming\","Save GRD File",3),srfGridFmtS7) Debug.Print ovrly.Grid.FileName End If Next ovrly End End Sub