Share via


ShowImportWizard method

Opens the Import Data Wizard; similar to clicking Import Data Wizard on the Data menu. Returns a DataSet object if one is created. Returns Nothing if the user cancels out of the wizard.

Applies to

Collections:  DataSets

Syntax

object.ShowImportWizard([HWndParent], [DataSourceMoniker], [Delimeter], [ImportFlags])

Parameters

Part Description
object Required. An expression that returns a DataSets collection.
HWndParent Optional Long. Handle of the user's window, to allow the Import Data Wizard to be modal to a window in the calling application, rather than MapPoint.

Note  Do not use a handle for a window other than the MapPoint window if the MapPoint window is visible.

DataSourceMoniker Optional String. File name to import. Can also provide information on which part of the file to import. See the DataSourceMoniker syntax topic for the correct syntax to use for this parameter. If a file name is not specified, the user interface will prompt the user for a file to import.
Delimiter Optional GeoDelimiter. Characters that separate individual fields. Can be one or more characters. Required for importing text (.txt) files. Default is geoDelimiterDefault.
GeoDelimiter Value Description
geoDelimiterComma
44
Fields separated by commas (","). Default for .csv files.
geoDelimiterDefault
0
MapPoint determines the delimiter based on the file type.
File type Default Delimiter
.asc tab
.csv comma
.tab tab
.txt tab
geoDelimiterSemicolon
59
Fields separated by semicolons.
geoDelimiterTab
9
Fields separated by tabs ("\t"). Default for .tab, .txt, and .asc files.
ImportFlags Optional Long. Provides information about the DataSourceMoniker and the data in the file. Multiple values can be passed by using the Visual Basic "Or" operator (for example, geoImportExcelNamedRange Or geoImportFirstRowIsNotHeadings).
GeoImportFlags Value Description
geoImportAccessQuery
4
DataSourceMoniker specifies an Access query.
geoImportAccessTable
0
DataSourceMoniker specifies an Access table. Default.
geoImportExcelA1
0
DataSourceMoniker specifies Excel A1 syntax. Default.
geoImportExcelNamedRange
4
DataSourceMoniker specifies an Excel named range.
geoImportExcelR1C1
2
DataSourceMoniker specifies Excel R1C1 syntax.
geoImportExcelSheet
0
DataSourceMoniker specifies an Excel worksheet. Default.
geoImportFirstRowIsHeadings
0
First row of the file contains field names. Default.
geoImportFirstRowNotHeadings
1
First row of the file does not contain field names.

Remarks

To import data as a DataSet object, use the ImportData method on a DataSets collection.

Example

    Sub ShowWizard()
    Dim objApp As New MapPoint.Application
    objApp.Visible = True
    objApp.UserControl = True
    Dim objDS As MapPoint.DataSet

    With objApp.ActiveMap.DataSets       Set objDS = .ShowImportWizard     End With   End sub

Example using parameters

    Sub ShowWizard()
    Dim objApp As New MapPoint.Application
    objApp.Visible = True
    objApp.UserControl = True
    Dim strFile As String
    Dim objDS As MapPoint.DataSet

    With objApp.ActiveMap.DataSets       'Excel sheet       strFile = objApp.Path & "\Samples\Sales.xls!Sheet1!A1:C22"       Set objDS = .ShowImportWizard(, strFile, , geoImportExcel)     End With   End sub