MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




obj.MoveTo / abjMap.AddPushpin issue

This is a discussion on obj.MoveTo / abjMap.AddPushpin issue within the MapPoint 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (3) Thread Tools Display Modes
  3 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 11-15-2007
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 11-16-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,105
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 11-16-2007
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
abjmapaddpushpin, issue, objmoveto


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/obj-moveto-abjmap-addpushpin-issue-6755.html

Posted By For Type Date
Programming with MapPoint 2004 using the .NET Framework - MapPoint Articles - MP2K Magazine This thread Refback 11-20-2007 04:39 AM
Excel User-Defined Functions and MapPoint - MapPoint Articles - MP2K Magazine This thread Refback 11-20-2007 04:39 AM
Apple Blog » Blog Archive » obj.MoveTo / abjMap.AddPushpin issue This thread Pingback 11-15-2007 11:09 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Mappoint Installation issue jacky3212 MP2K Magazine Articles 2 07-19-2008 12:08 AM
Issue with RenderService and rendering a map megabot MapPoint Web Service and Virtual Earth 0 09-18-2007 05:12 PM
Lat and Long issue hprider MapPoint Web Service and Virtual Earth 2 07-03-2007 10:16 AM
java issue Anonymous MapPoint 2006/2009 Discussion 1 03-01-2005 05:11 PM
vb6 server issue starbuck MapPoint 2006/2009 Discussion 1 04-15-2004 10:27 AM


All times are GMT -5. The time now is 09:42 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Ski Weekend
Slip in a sneaky ski weekend to add a bit of variety compared to normal weekends. A ski weekend can be great value when you book online at Holiday Hypermarket.

Flights to Spain
Find and book flights to Spain. Travel Counsellors can help with travel to Spain including flights and accommodation.

Holidays Italy
Book your holidays in Italy. Italy has a great climate and the beaches to go with it. Book a great deal for great value online at dealchecker.co.uk.

All Inclusive Maldives
Visit The Holiday Place.co.uk for great deals on all inclusive holidays to the Maldives. Book a holiday to the outstandingly beautiful Maldives.

Holidays
For bargain holidays to destinations including Mexico, South Africa, India and more, visit ULookUBook online today. Check out our free travel guides to help you make an informed decision for your holidays.

Price comparison sites
Travel.co.uk is the one you are looking for when checking out price comparison sites.

Holidays to Sharm el Sheikh
Want to visit the Sinai peninsula? We can help. Info on holidays to Sharm el Sheikh, only at On The Beach.


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