Sub Main 'Creates an instance of the MapViewer Application object and assigns it to 'the variable named "mvApp" Set mvApp = CreateObject("MapViewer.Application") 'Makes the application main window visible mvApp.Visible = True 'Prompts user for boundary file and assigns it to the variable named '"BoundaryFile" BoundaryFile = GetFilePath(,"gsb",,"Specify Map Boundary File") 'Prompts user for data file and assigns it to the variable named "DataFile" DataFile = GetFilePath(,"dat",,"Specify Data Boundary File") 'Creates a map document object, and assigns it to the variable named "Plot" Set Plot = mvApp.Documents.Add(DocType:=mvDocPlot) 'Assigns the current layer to the variable named "HatchLayer" Set HatchLayer = Plot.Layers.ActiveLayer 'Creates a hatch map object and assigns it to the variable named "HatchMap" Set HatchMap = Plot.CreateHatchMap(BoundaryFile, DataFile, "", "", 1, 5, 4) 'Add a Legend To the Map, Including the current Date Set Legend = HatchMap.AddLayerToLegend("Layer #1") 'Set the date equal to the variable "CurrentDate" CurrentDate = Date 'Create a Title for the Legend, including the date Legend.Title("Layer #1") = "Map Report for: " + CurrentDate 'Position Legend on Page Legend.Left=9 Legend.Top=2 'Close current map window and saves the map as a GSM file with the current 'data as the file name 'Plot.Close(SaveChanges:=3) End Sub