Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

obj.MoveTo / abjMap.AddPushpin issue

This is a discussion on obj.MoveTo / abjMap.AddPushpin issue within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am trying to get mappoint to make push pins for a list of sites and move them to a ...

  1. #1
    burnin240sx is offline Junior Member White Belt
    Join Date
    Sep 2007
    Posts
    2

    obj.MoveTo / objMap.AddPushpin issue

    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?

    Code:
     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
    Last edited by burnin240sx; 11-15-2007 at 11:06 AM.

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: obj.MoveTo / abjMap.AddPushpin issue

    Hi,

    You give a PushPin object as first argument to the AddPushPin method. This is wrong, you have to create first a Location object and the Location object has to be the first argument for the AddPushPin method.

  3. #3
    burnin240sx is offline Junior Member White Belt
    Join Date
    Sep 2007
    Posts
    2

    Re: obj.MoveTo / abjMap.AddPushpin issue

    i have switched up my code and i have got this to work
    but now i'm trying to figure out how to give the push pin a name. right now it uses the address as the name.
    Code:
    Private Sub CommandButton1_Click()
    Dim objApp As New MapPoint.Application
    Dim objMap As MapPoint.Map
    Dim feLoc As MapPoint.Pushpin
    Dim siteLoc 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 feLoc = objMap.AddPushpin( _
    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))
    feLoc.MoveTo objMap.DataSets.Item("FEs")
    End If
    Next

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Mappoint Installation issue
    By jacky3212 in forum MP2K Magazine Articles
    Replies: 2
    Last Post: 07-19-2008, 12:08 AM
  2. Issue with RenderService and rendering a map
    By megabot in forum Bing Maps and MapPoint Web Service
    Replies: 0
    Last Post: 09-18-2007, 05:12 PM
  3. Lat and Long issue
    By hprider in forum Bing Maps and MapPoint Web Service
    Replies: 2
    Last Post: 07-03-2007, 10:16 AM
  4. java issue
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-01-2005, 05:11 PM
  5. vb6 server issue
    By starbuck in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-15-2004, 10:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91