Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| obj.MoveTo / objMap.AddPushpin issue 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. |
| |||
| 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.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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
|
![]() |
| Tags |
| abjmapaddpushpin, issue, objmoveto |
| ||||
| 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 | |
| |
| ||||
| 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 |
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.