KB no longer maintained - MapViewer is a Legacy Product. Legacy Products are still supported, but no longer receive new features or updates. Many of MapViewer's features have been moved to Surfer. Please contact support@goldensoftware.com with any questions. |
This article contains a sample script for creating and editing a worksheet.
To run this script:
- Copy the script below, or click here to download the BAS file: Worksheet.BAS.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\MapViewer 8\Scripter.
- Double click on Scripter.exe to launch Scripter.
- Press Ctrl+A to select all of the existing lines then press Delete.
- If you copied this script, press Ctrl+V to paste it into Scripter. If you downloaded it, click File | Open, select the BAS file from your downloads directory, and click Open.
- Click Script | Run to run the script.
*********
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Worksheet.BAS ' Copyright (C) Golden Software Inc. 1992-2015 ' ' This sample demonstrates how to to create worksheet. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub Main 'Creates an instance of the MapViewer Application object ' and assigns it to the variable named "MapViewerApp" Set MapViewerApp = CreateObject("MapViewer.Application") 'Makes the application main window visible MapViewerApp.Visible = True 'Creates a worksheet document object, and assigns it to the variable named "doc" Set doc = MapViewerApp.Documents.Add(DocType:=mvDocWks) 'Add some data to the worksheet document doc.Cells("A3").Value = 1 doc.Cells("A4").Value = 2 doc.Cells("A5").Value = 3 doc.Cells("B3").Value = 4 doc.Cells("B4").Value = 5 doc.Cells("B5").Value = 6 'Assigns the Windows list associated with this document to the variable named "WksWindows" Set WksWindows = doc.Windows 'Assigns the first window in the Windows list to the variable named "win" Set win = WksWindows(1) 'Makes "A3" cell active win.ActiveCell = "A3" If win.ActiveCell.Name <> "A3:A3" Then Stop 'Selects cells A3 through A5 win.Selection = "A3:A5" If win.Selection.Name <> "A3:A5" Then Stop 'Checks Caption If win.Caption <> "Sheet1" Then Stop 'MapViewerApp.Quit End Sub
Updated November 2, 2016
Comments
0 comments
Please sign in to leave a comment.