MapPoint and VBA - Any Active Users?

lummers

New Member
Joined
Dec 10, 2017
Messages
9
Hello all

1st post on the forums but have been a long-time browser :)


I am wondering if anybody can help point me to some good MapPoint resources or can help me with some code. I think what I am trying to do is quite simple but struggling to get started.


In Excel, I will have a list of Routes with postcodes:


BusinessPin TitleID NumberPostcodeRoute
Cake and CookiesCake and Cookie (1234)1234AB1 2DERoute 01
Hot Choc IncHot Choc Inc (5678)5678FG3 4HIRoute 02

<tbody>
</tbody>


I want each of the routes to be made into their own pushpin set. So Route 1 will have pins for every postcode, Route 2 will be its own set, etc.


Then, I will apply some formula in Excel to ultimately give a 'Red'/'Amber'/'Green' status to each postcode (e.g. via text string). I then want each individual pushpin to change icon/colour based on that status.

Can anybody give me a solid starter for 10? I have tried to read the MapPoint developer documentation but it is beyond my current capabilities: https://msdn.microsoft.com/en-us/library/aa562254.aspx

I also fear that some code I am trying to use is incompatible with my versions (regional differences, version differences, etc.)

Excel 2016 32-Bit
MapPoint EU 2013

Big thanks to any one still using the deprecated software!!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
OK, I have made a little bit of progress.

First thing to do is open new Excel and new MapPoint. Then, open VBA and go to Tools -> References. Then, select 'Microsoft MapPoint Control 19.0'.

Putting in the following code allows me to create a pushpin set called "I am Spartacus" and places a pushpin on the postcode. It's a start...

Code:
    Sub NewPushpinSet()
    Dim oMap As MapPoint.Map
    Set oMap = GetObject(, "MapPoint.Application").ActiveMap


    Dim oPPSet As MapPoint.DataSet
    Dim oPin As MapPoint.Pushpin
    Dim oDS As MapPoint.DataSets


    Set oPin = oMap.AddPushpin(oMap.FindResults( _
        "SW1A 2AA")(1))


    Set oDS = oMap.DataSets
    Set oPPSet = oMap.DataSets.AddPushpinSet("I am spartcaus")
    oPin.MoveTo oPPSet
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top