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

'Creates a post map and assigns the map frame to the variable "MapFrame"
	Set MapFrame = Plot.Shapes.AddPostMap(SurferApp.Path+"\samples\demogrid+colors.dat")

'Declares PostLayer as an Object and assigns the post map to variable "PostLayer"
	Dim PostLayer As Object
	Set PostLayer = MapFrame.Overlays(1)

'Sets the worksheet rows and symbol frequency
	PostLayer.FirstRow = 5
	PostLayer.LastRow = 40
	PostLayer.SymFrequency = 2

'Sets the SYMBOL properties.
	'Sets the symbol column
	PostLayer.SymCol = 5

	'For all symbol marker properties, see MarkerFormat object.
	PostLayer.Symbol.Set = "GSI Default Symbols"
	PostLayer.Symbol.Index= 6
	PostLayer.Symbol.FillColorRGBA.Color = srfColorRed
	PostLayer.Symbol.LineColorRGBA.Color = srfColorCyan

	'Sets the angle value for the symbols
	PostLayer.AngleCol = 3
	PostLayer.SymAngle = 315

	'Sets the symbol scaling
	PostLayer.SetSymbolScaling(Method:=srfPostLinear, SymbolHeight1:=0.1, SymbolHeight2:=0.5, ScaleValue1:=1, ScaleValue2:=100, HeightCol:=3)

	'Sets symbol color to numeric based on colormap
	PostLayer.SymbolColorCol = 3
	PostLayer.SymbolColorMethod = srfSymbolColorMethodGradient
	PostLayer.SymbolColorMap.LoadPreset("Rainbow2")

	'Sets symbol color column to explicit colors
	PostLayer.SymbolColorCol = 4
	PostLayer.SymbolColorMethod = srfSymbolColorMethodExplicit

'Sets the LABEL properites
	'Sets three label sets
	PostLayer.NumLabelSets = 3

	'Sets the first label set to be the active label set, and then changes the properties for Set 1
	PostLayer.ActiveLabelSet = 1
	PostLayer.LabCol = 3

		'Sets the label format properties. For all options, see LabelFormat object.
		PostLayer.LabelFormat.NumDigits = 1
		PostLayer.LabelFormat.Type = srfLabFixed

		'Sets the label font properties. For all optiosn, see FontFormat object.
		PostLayer.LabelFont.Face = "Comic Sans MS"
  		PostLayer.LabelFont.Size = 14
  		PostLayer.LabelFont.ForeColorRGBA.Color = srfColorBlue
  		PostLayer.LabelFont.Bold = True
  		PostLayer.LabelFont.BackColorRGBA.Opacity = 50

		'Sets the angle for the label text
  		PostLayer.LabelAngle = 30

		'Sets the label position relative to the symbol
  		PostLayer.LabelPos = srfPostPosUser
  		PostLayer.LabelPos = srfPostPosUser

		'Sets the X and Y offset for custom label positions relative to the symbol. This is only active if the LabelPos above is set to User (User Defined).
 		PostLayer.LabelXOffset = 0.02
  		PostLayer.LabelYOffset = 0.01

		'Sets the 3D label line properties. See LineFormat object for all line property options.
		PostLayer.LabelLine.ForeColorRGBA.Color = srfColorGreen

		'Sets the length of the 3D label lines
		PostLayer.LabelLineLength = 0.5

		'Sets the plane for the labels
		PostLayer.LabelPlane = srfPostScreen

	'Sets the second label set to be the active label set, and then changes the properties for Set 2
	PostLayer.ActiveLabelSet = 2
	PostLayer.LabCol = 5

	'Sets the third label set to be the active label set, and then changes the properties for Set 3
	PostLayer.ActiveLabelSet = 3
	PostLayer.LabCol = 4
  		PostLayer.LabelAngle = 30
  		PostLayer.LabelPos = srfPostPosUser
  		PostLayer.LabelPos = srfPostPosUser
 		PostLayer.LabelXOffset = 0.15
  		PostLayer.LabelYOffset = -0.15
  		PostLayer.LabelFont.Bold = True

	'Remove the second label set
	PostLayer.RemoveLabelSet(Index:=2)

'Sets the opacity of the post layer
	PostLayer.Opacity = 80

End Sub
