Dim mpApp As MapPoint.Application
Dim mpDatasets As MapPoint.DataSets
Dim mpDataSet As MapPoint.DataSet
Dim myExampleArray(4, 2)
'Start MapPoint
Set mpApp = New MapPoint.Application
mpApp.Visible = True
mpApp.UserControl = True
'Get the DataSets collection
Set mpDatasets = mpApp.NewMap.DataSets
'Create the ArrayOfFields descriptions
'Field is specified by name
myExampleArray(1, 1) = "Latitude"
'tells MapPoint to use this field as the latitude field
myExampleArray(1, 2) = geoFieldLatitude
'Field again specifed by name
myExampleArray(2, 1) = "Longitude"
'tells MapPoint to use this field as the longitude field
myExampleArray(2, 2) = geoFieldLongitude
'Field is listed by index, rather than name
myExampleArray(3, 1) = 1
'tells MapPoint to use this field as additional (non geocoding) information
myExampleArray(3, 2) = geoFieldData
'Field is specified by source name
myExampleArray(4, 1) = "ExDat"
'New field name after import--when changing the name,
'MapPoint assumes that the type is geoFieldData
myExampleArray(4, 2) = "ExampleData"
'Perform the import
Set mpDataSet = mpDatasets.ImportData("c:\foo.xls!Sheet1!A1:B4", myExampleArray)
'The (x,2) elements are of the type GeoFieldType or string.
'If string, then they set the new name of the field, and
'MapPoint assumes that the field is a nongeocoding data field.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.