PDA

View Full Version : Trouble linking Excel data to Mappoint 2010



VRON5
04-28-2014, 02:55 PM
Hello, I am trying to import a workbook from excel into Mappoint using VBA. I am very new at using VBA. The workbook has multiple sheets and I want the data in each sheet to be a mapped and have a different color pushpin.


I am having trouble mapping any data in Mappoint. I tried to start with this simple code:

Dim sAPP As MapPoint.Application
Private Sub Workbook_Open()
Set sAPP = CreateObject("MapPoint.Application.NA.17")
sAPP.Visible = True
End Sub
Sub OpenDataSet()
Dim objDataSets As MapPoint.DataSets
Dim objDataSet As MapPoint.DataSet
Dim zDataSource As String
zDataSource = "C:\Users\Desktop\MappingTool 4.27.xlsm!PastDue!"
Set objDataSets = sAPP.ActiveMap.DataSets
Set objDataSet = objDataSets.ImportData(zDataSource)
End Sub

The first part open Mappoint but the second Sub gives me: Error '4030' Method 'ImportData' of object 'DataSets
Also I have looked at the MP2K Mag code and other posts but have not been able to figure it out.

I would greatly appreciate any help! Thank you so much