burnin240sx
11-15-2007, 10:54 AM
I am trying to get mappoint to make push pins for a list of sites and move them to a pushpin set called FEs.
this code creates the pushpins but craps on it self with runtime error '13' when i get to "objMap.AddPushpin objPin."
if i comment out "Dim objPin As MapPoint.Pushpin" then it gives me a error of "object doesn't suppot this property type or method" when i get to line "objPin.MoveTo objMap.DataSets.Item("FEs")"
I think that i'm creating the pushPin using the wrong method. but I don't know any other way.
any idea's?
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objPin As MapPoint.Pushpin
'Set up the application
Set objMap = objApp.ActiveMap
objApp.Visible = True
objApp.UserControl = True
objMap.DataSets.AddPushpinSet "FEs"
'start for loop
For f = 0 To 21
' build fe pushppins
If Len(Worksheets("Sheet2").Cells(2 + f, 1)) > 0 Then
Set objPin = _
objMap.FindAddressResults( _
Worksheets("Sheet2").Cells(2 + f, 2), _
Worksheets("Sheet2").Cells(2 + f, 3), _
Worksheets("Sheet2").Cells(2 + f, 4), _
Worksheets("Sheet2").Cells(2 + f, 5))(1)
objMap.AddPushpin objPin, _
Worksheets("Sheet2").Cells(2 + f, 1)
objPin.MoveTo objMap.DataSets.Item("FEs")
End If
objPin.MoveTo objMap.DataSets.Item("FEs")
Next
this code creates the pushpins but craps on it self with runtime error '13' when i get to "objMap.AddPushpin objPin."
if i comment out "Dim objPin As MapPoint.Pushpin" then it gives me a error of "object doesn't suppot this property type or method" when i get to line "objPin.MoveTo objMap.DataSets.Item("FEs")"
I think that i'm creating the pushPin using the wrong method. but I don't know any other way.
any idea's?
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objPin As MapPoint.Pushpin
'Set up the application
Set objMap = objApp.ActiveMap
objApp.Visible = True
objApp.UserControl = True
objMap.DataSets.AddPushpinSet "FEs"
'start for loop
For f = 0 To 21
' build fe pushppins
If Len(Worksheets("Sheet2").Cells(2 + f, 1)) > 0 Then
Set objPin = _
objMap.FindAddressResults( _
Worksheets("Sheet2").Cells(2 + f, 2), _
Worksheets("Sheet2").Cells(2 + f, 3), _
Worksheets("Sheet2").Cells(2 + f, 4), _
Worksheets("Sheet2").Cells(2 + f, 5))(1)
objMap.AddPushpin objPin, _
Worksheets("Sheet2").Cells(2 + f, 1)
objPin.MoveTo objMap.DataSets.Item("FEs")
End If
objPin.MoveTo objMap.DataSets.Item("FEs")
Next